2014-07-13 01:04:16 +02:00
|
|
|
//// [objectTypeHidingMembersOfObject.ts]
|
|
|
|
// all of these valueOf calls should return the type shown in the overriding signatures here
|
|
|
|
|
|
|
|
class C {
|
|
|
|
valueOf() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
var c: C;
|
|
|
|
var r1: void = c.valueOf();
|
|
|
|
|
|
|
|
interface I {
|
|
|
|
valueOf(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
var i: I;
|
|
|
|
var r2: void = i.valueOf();
|
|
|
|
|
|
|
|
var a = {
|
|
|
|
valueOf: () => { }
|
|
|
|
}
|
|
|
|
|
|
|
|
var r3: void = a.valueOf();
|
|
|
|
|
|
|
|
var b: {
|
|
|
|
valueOf(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
var r4: void = b.valueOf();
|
|
|
|
|
|
|
|
//// [objectTypeHidingMembersOfObject.js]
|
2014-08-14 15:42:18 +02:00
|
|
|
// all of these valueOf calls should return the type shown in the overriding signatures here
|
2014-07-13 01:04:16 +02:00
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
C.prototype.valueOf = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return C;
|
|
|
|
})();
|
|
|
|
var c;
|
|
|
|
var r1 = c.valueOf();
|
|
|
|
var i;
|
|
|
|
var r2 = i.valueOf();
|
|
|
|
var a = {
|
2015-02-07 03:45:09 +01:00
|
|
|
valueOf: function () { }
|
2014-07-13 01:04:16 +02:00
|
|
|
};
|
|
|
|
var r3 = a.valueOf();
|
|
|
|
var b;
|
|
|
|
var r4 = b.valueOf();
|