TypeScript/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.types

26 lines
594 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/contextualTypingOfLambdaWithMultipleSignatures.ts ===
interface Foo {
>Foo : Foo
2014-08-15 23:33:16 +02:00
getFoo(n: number): void;
>getFoo : { (n: number): void; (s: string): void; }
>n : number
2014-08-15 23:33:16 +02:00
getFoo(s: string): void;
>getFoo : { (n: number): void; (s: string): void; }
>s : string
2014-08-15 23:33:16 +02:00
}
var foo: Foo;
>foo : Foo
>Foo : Foo
2014-08-15 23:33:16 +02:00
foo.getFoo = bar => { };
>foo.getFoo = bar => { } : (bar: any) => void
>foo.getFoo : { (n: number): void; (s: string): void; }
>foo : Foo
>getFoo : { (n: number): void; (s: string): void; }
2014-08-15 23:33:16 +02:00
>bar => { } : (bar: any) => void
>bar : any
2014-08-15 23:33:16 +02:00