TypeScript/tests/baselines/reference/localTypes3.js
Anders Hejlsberg 5eff0a5fae Adding tests
2015-05-26 12:03:13 -07:00

93 lines
1.7 KiB
TypeScript

//// [localTypes3.ts]
function f1() {
function f() {
class C<X, Y> {
constructor(public x: X, public y: Y) { }
}
return C;
}
let C = f();
let v = new C(10, "hello");
let x = v.x;
let y = v.y;
}
function f2() {
function f<X>(x: X) {
class C<Y> {
public x = x;
constructor(public y: Y) { }
}
return C;
}
let C = f(10);
let v = new C("hello");
let x = v.x;
let y = v.y;
}
function f3() {
function f<X, Y>(x: X, y: Y) {
class C {
public x = x;
public y = y;
}
return C;
}
let C = f(10, "hello");
let v = new C();
let x = v.x;
let y = v.y;
}
//// [localTypes3.js]
function f1() {
function f() {
var C = (function () {
function C(x, y) {
this.x = x;
this.y = y;
}
return C;
})();
return C;
}
var C = f();
var v = new C(10, "hello");
var x = v.x;
var y = v.y;
}
function f2() {
function f(x) {
var C = (function () {
function C(y) {
this.y = y;
this.x = x;
}
return C;
})();
return C;
}
var C = f(10);
var v = new C("hello");
var x = v.x;
var y = v.y;
}
function f3() {
function f(x, y) {
var C = (function () {
function C() {
this.x = x;
this.y = y;
}
return C;
})();
return C;
}
var C = f(10, "hello");
var v = new C();
var x = v.x;
var y = v.y;
}