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
|
|
|
|
|
|
|
|
var b: Ib = { m: function (test: string, fn: Function) { } };
|
|
|
|
>b : Ib
|
|
|
|
>Ib : Ib
|
|
|
|
>{ m: function (test: string, fn: Function) { } } : { m: (test: string, fn: Function) => void; }
|
|
|
|
>m : (test: string, fn: Function) => void
|
|
|
|
>function (test: string, fn: Function) { } : (test: string, fn: Function) => void
|
|
|
|
>test : string
|
|
|
|
>fn : Function
|
|
|
|
>Function : Function
|
|
|
|
|
|
|
|
b.m("test", function (bug) {
|
2014-08-22 03:39:46 +02:00
|
|
|
>b.m("test", function (bug) { var a: number = bug;}) : any
|
2014-08-15 23:33:16 +02:00
|
|
|
>b.m : (test: string, fn: Function) => any
|
|
|
|
>b : Ib
|
|
|
|
>m : (test: string, fn: Function) => any
|
2014-08-22 03:39:46 +02:00
|
|
|
>function (bug) { var a: number = bug;} : (bug: any) => void
|
2014-08-15 23:33:16 +02:00
|
|
|
>bug : any
|
|
|
|
|
|
|
|
var a: number = bug;
|
|
|
|
>a : number
|
|
|
|
>bug : any
|
|
|
|
|
|
|
|
});
|