1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
//// [tests/cases/compiler/undeclaredMethod.ts] ////
=== undeclaredMethod.ts ===
module M {
>M : typeof M
export class C {
>C : C
public salt() {}
>salt : () => void
}
}
var c:M.C = new M.C();
>c : M.C
>M : any
>new M.C() : M.C
>M.C : typeof M.C
>M : typeof M
>C : typeof M.C
c.salt(); // cool
>c.salt() : void
>c.salt : () => void
>c : M.C
>salt : () => void
c.saltbar(); // crash
>c.saltbar() : any
>c.saltbar : any
>c : M.C
>saltbar : any
|