26 lines
533 B
Text
26 lines
533 B
Text
=== tests/cases/compiler/assignToFn.ts ===
|
|
module M {
|
|
>M : typeof M
|
|
|
|
interface I {
|
|
f(n:number):boolean;
|
|
>f : (n: number) => boolean
|
|
>n : number
|
|
}
|
|
|
|
var x:I={ f:function(n) { return true; } };
|
|
>x : I
|
|
>{ f:function(n) { return true; } } : { f: (n: number) => true; }
|
|
>f : (n: number) => true
|
|
>function(n) { return true; } : (n: number) => true
|
|
>n : number
|
|
>true : true
|
|
|
|
x.f="hello";
|
|
>x.f="hello" : "hello"
|
|
>x.f : (n: number) => boolean
|
|
>x : I
|
|
>f : (n: number) => boolean
|
|
>"hello" : "hello"
|
|
}
|
|
|