File: inferSecondaryParameter.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (30 lines) | stat: -rw-r--r-- 903 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
=== tests/cases/compiler/inferSecondaryParameter.ts ===
// type inference on 'bug' should give 'any'

interface Ib { m(test: string, fn: Function); }
>m : (test: string, fn: Function) => any
>test : string
>fn : Function

var b: Ib = { m: function (test: string, fn: Function) { } };
>b : 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

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

    var a: number = bug;
>a : number
>bug : any

});