2015-02-03 00:15:54 +01:00
|
|
|
//// [assignmentCompatBug3.ts]
|
|
|
|
function makePoint(x: number, y: number) {
|
|
|
|
return {
|
|
|
|
get x() { return x;}, // shouldn't be "void"
|
|
|
|
get y() { return y;}, // shouldn't be "void"
|
|
|
|
//x: "yo",
|
|
|
|
//y: "boo",
|
|
|
|
dist: function () {
|
|
|
|
return Math.sqrt(x*x+y*y); // shouldn't be picking up "x" and "y" from the object lit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class C {
|
|
|
|
get x() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function foo(test: string) { }
|
|
|
|
|
|
|
|
var x: any;
|
|
|
|
var y: any;
|
|
|
|
|
|
|
|
foo(x);
|
|
|
|
foo(x + y);
|
|
|
|
|
|
|
|
//// [assignmentCompatBug3.js]
|
|
|
|
function makePoint(x, y) {
|
|
|
|
return {
|
2015-02-07 05:03:24 +01:00
|
|
|
get x() { return x; },
|
|
|
|
get y() { return y; },
|
2015-02-03 00:15:54 +01:00
|
|
|
//x: "yo",
|
|
|
|
//y: "boo",
|
|
|
|
dist: function () {
|
|
|
|
return Math.sqrt(x * x + y * y); // shouldn't be picking up "x" and "y" from the object lit
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
|
|
|
Object.defineProperty(C.prototype, "x", {
|
|
|
|
get: function () {
|
|
|
|
return 0;
|
|
|
|
},
|
|
|
|
enumerable: true,
|
|
|
|
configurable: true
|
|
|
|
});
|
|
|
|
return C;
|
|
|
|
})();
|
2015-02-07 03:45:09 +01:00
|
|
|
function foo(test) { }
|
2015-02-03 00:15:54 +01:00
|
|
|
var x;
|
|
|
|
var y;
|
|
|
|
foo(x);
|
|
|
|
foo(x + y);
|