34 lines
967 B
Text
34 lines
967 B
Text
=== 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) {
|
|
>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
|
|
>"test" : string
|
|
>function (bug) { var a: number = bug;} : (bug: any) => void
|
|
>bug : any
|
|
|
|
var a: number = bug;
|
|
>a : number
|
|
>bug : any
|
|
|
|
});
|