TypeScript/tests/baselines/reference/inferSecondaryParameter.types

35 lines
967 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/inferSecondaryParameter.ts ===
// type inference on 'bug' should give 'any'
interface Ib { m(test: string, fn: Function); }
>Ib : Ib
>m : (test: string, fn: Function) => any
>test : string
>fn : Function
>Function : Function
2014-08-15 23:33:16 +02:00
var b: Ib = { m: function (test: string, fn: Function) { } };
>b : Ib
>Ib : Ib
2014-08-15 23:33:16 +02:00
>{ m: function (test: string, fn: Function) { } } : { m: (test: string, fn: Function) => void; }
>m : (test: string, fn: Function) => void
2014-08-15 23:33:16 +02:00
>function (test: string, fn: Function) { } : (test: string, fn: Function) => void
>test : string
>fn : Function
>Function : Function
2014-08-15 23:33:16 +02:00
b.m("test", function (bug) {
2014-08-22 03:39:46 +02:00
>b.m("test", function (bug) { var a: number = bug;}) : any
>b.m : (test: string, fn: Function) => any
>b : Ib
>m : (test: string, fn: Function) => any
2015-04-13 21:36:11 +02:00
>"test" : string
2014-08-22 03:39:46 +02:00
>function (bug) { var a: number = bug;} : (bug: any) => void
>bug : any
2014-08-15 23:33:16 +02:00
var a: number = bug;
>a : number
>bug : any
2014-08-15 23:33:16 +02:00
});