2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/types/members/objectTypeHidingMembersOfObject.ts ===
|
|
|
|
// all of these valueOf calls should return the type shown in the overriding signatures here
|
|
|
|
|
|
|
|
class C {
|
|
|
|
>C : C
|
|
|
|
|
|
|
|
valueOf() { }
|
|
|
|
>valueOf : () => void
|
|
|
|
}
|
|
|
|
|
|
|
|
var c: C;
|
|
|
|
>c : C
|
|
|
|
>C : C
|
|
|
|
|
|
|
|
var r1: void = c.valueOf();
|
|
|
|
>r1 : void
|
|
|
|
>c.valueOf() : void
|
|
|
|
>c.valueOf : () => void
|
|
|
|
>c : C
|
|
|
|
>valueOf : () => void
|
|
|
|
|
|
|
|
interface I {
|
|
|
|
>I : I
|
|
|
|
|
|
|
|
valueOf(): void;
|
|
|
|
>valueOf : () => void
|
|
|
|
}
|
|
|
|
|
|
|
|
var i: I;
|
|
|
|
>i : I
|
|
|
|
>I : I
|
|
|
|
|
|
|
|
var r2: void = i.valueOf();
|
|
|
|
>r2 : void
|
|
|
|
>i.valueOf() : void
|
|
|
|
>i.valueOf : () => void
|
|
|
|
>i : I
|
|
|
|
>valueOf : () => void
|
|
|
|
|
|
|
|
var a = {
|
|
|
|
>a : { valueOf: () => void; }
|
2014-08-22 03:39:46 +02:00
|
|
|
>{ valueOf: () => { }} : { valueOf: () => void; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
valueOf: () => { }
|
|
|
|
>valueOf : () => void
|
|
|
|
>() => { } : () => void
|
|
|
|
}
|
|
|
|
|
|
|
|
var r3: void = a.valueOf();
|
|
|
|
>r3 : void
|
|
|
|
>a.valueOf() : void
|
|
|
|
>a.valueOf : () => void
|
|
|
|
>a : { valueOf: () => void; }
|
|
|
|
>valueOf : () => void
|
|
|
|
|
|
|
|
var b: {
|
|
|
|
>b : { valueOf(): void; }
|
|
|
|
|
|
|
|
valueOf(): void;
|
|
|
|
>valueOf : () => void
|
|
|
|
}
|
|
|
|
|
|
|
|
var r4: void = b.valueOf();
|
|
|
|
>r4 : void
|
|
|
|
>b.valueOf() : void
|
|
|
|
>b.valueOf : () => void
|
|
|
|
>b : { valueOf(): void; }
|
|
|
|
>valueOf : () => void
|
|
|
|
|