File: genericCallWithObjectTypeArgsAndIndexers.symbols

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 (62 lines) | stat: -rw-r--r-- 2,925 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexers.ts ===
// Type inference infers from indexers in target type, no errors expected

function foo<T>(x: T) {
>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0))
>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 13))
>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 16))
>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 13))

    return x;
>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 16))
}

var a: {
>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 6, 3))

    [x: string]: Object;
>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 7, 5))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

    [x: number]: Date;
>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 8, 5))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))

};
var r = foo(a);
>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 10, 3))
>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0))
>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 6, 3))

function other<T extends Date>(arg: T) {
>other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 10, 15))
>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 31))
>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15))

    var b: {
>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 13, 7))

        [x: string]: Object;
>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 14, 9))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

        [x: number]: T
>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 15, 9))
>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15))

    };
    var r2 = foo(b);
>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7))
>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0))
>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 13, 7))

    var d = r2[1]; 
>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 18, 7))
>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7))

    var e = r2['1']; 
>e : Symbol(e, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 19, 7))
>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7))
}