File: typeInferenceWithTupleType.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 (100 lines) | stat: -rw-r--r-- 4,762 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
=== tests/cases/conformance/types/tuple/typeInferenceWithTupleType.ts ===
function combine<T, U>(x: T, y: U): [T, U] {
>combine : Symbol(combine, Decl(typeInferenceWithTupleType.ts, 0, 0))
>T : Symbol(T, Decl(typeInferenceWithTupleType.ts, 0, 17))
>U : Symbol(U, Decl(typeInferenceWithTupleType.ts, 0, 19))
>x : Symbol(x, Decl(typeInferenceWithTupleType.ts, 0, 23))
>T : Symbol(T, Decl(typeInferenceWithTupleType.ts, 0, 17))
>y : Symbol(y, Decl(typeInferenceWithTupleType.ts, 0, 28))
>U : Symbol(U, Decl(typeInferenceWithTupleType.ts, 0, 19))
>T : Symbol(T, Decl(typeInferenceWithTupleType.ts, 0, 17))
>U : Symbol(U, Decl(typeInferenceWithTupleType.ts, 0, 19))

    return [x, y];
>x : Symbol(x, Decl(typeInferenceWithTupleType.ts, 0, 23))
>y : Symbol(y, Decl(typeInferenceWithTupleType.ts, 0, 28))
}

var combineResult = combine("string", 10);
>combineResult : Symbol(combineResult, Decl(typeInferenceWithTupleType.ts, 4, 3))
>combine : Symbol(combine, Decl(typeInferenceWithTupleType.ts, 0, 0))

var combineEle1 = combineResult[0]; // string
>combineEle1 : Symbol(combineEle1, Decl(typeInferenceWithTupleType.ts, 5, 3))
>combineResult : Symbol(combineResult, Decl(typeInferenceWithTupleType.ts, 4, 3))
>0 : Symbol(0)

var combineEle2 = combineResult[1]; // number
>combineEle2 : Symbol(combineEle2, Decl(typeInferenceWithTupleType.ts, 6, 3))
>combineResult : Symbol(combineResult, Decl(typeInferenceWithTupleType.ts, 4, 3))
>1 : Symbol(1)

function zip<T, U>(array1: T[], array2: U[]): [[T, U]] {
>zip : Symbol(zip, Decl(typeInferenceWithTupleType.ts, 6, 35))
>T : Symbol(T, Decl(typeInferenceWithTupleType.ts, 8, 13))
>U : Symbol(U, Decl(typeInferenceWithTupleType.ts, 8, 15))
>array1 : Symbol(array1, Decl(typeInferenceWithTupleType.ts, 8, 19))
>T : Symbol(T, Decl(typeInferenceWithTupleType.ts, 8, 13))
>array2 : Symbol(array2, Decl(typeInferenceWithTupleType.ts, 8, 31))
>U : Symbol(U, Decl(typeInferenceWithTupleType.ts, 8, 15))
>T : Symbol(T, Decl(typeInferenceWithTupleType.ts, 8, 13))
>U : Symbol(U, Decl(typeInferenceWithTupleType.ts, 8, 15))

    if (array1.length != array2.length) {
>array1.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))
>array1 : Symbol(array1, Decl(typeInferenceWithTupleType.ts, 8, 19))
>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))
>array2.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))
>array2 : Symbol(array2, Decl(typeInferenceWithTupleType.ts, 8, 31))
>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))

        return [[undefined, undefined]];
>undefined : Symbol(undefined)
>undefined : Symbol(undefined)
    }
    var length = array1.length;
>length : Symbol(length, Decl(typeInferenceWithTupleType.ts, 12, 7))
>array1.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))
>array1 : Symbol(array1, Decl(typeInferenceWithTupleType.ts, 8, 19))
>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))

    var zipResult: [[T, U]];
>zipResult : Symbol(zipResult, Decl(typeInferenceWithTupleType.ts, 13, 7))
>T : Symbol(T, Decl(typeInferenceWithTupleType.ts, 8, 13))
>U : Symbol(U, Decl(typeInferenceWithTupleType.ts, 8, 15))

    for (var i = 0; i < length; ++i) {
>i : Symbol(i, Decl(typeInferenceWithTupleType.ts, 14, 12))
>i : Symbol(i, Decl(typeInferenceWithTupleType.ts, 14, 12))
>length : Symbol(length, Decl(typeInferenceWithTupleType.ts, 12, 7))
>i : Symbol(i, Decl(typeInferenceWithTupleType.ts, 14, 12))

        zipResult.push([array1[i], array2[i]]);
>zipResult.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>zipResult : Symbol(zipResult, Decl(typeInferenceWithTupleType.ts, 13, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>array1 : Symbol(array1, Decl(typeInferenceWithTupleType.ts, 8, 19))
>i : Symbol(i, Decl(typeInferenceWithTupleType.ts, 14, 12))
>array2 : Symbol(array2, Decl(typeInferenceWithTupleType.ts, 8, 31))
>i : Symbol(i, Decl(typeInferenceWithTupleType.ts, 14, 12))
    }
    return zipResult;
>zipResult : Symbol(zipResult, Decl(typeInferenceWithTupleType.ts, 13, 7))
}

var zipResult = zip(["foo", "bar"], [5, 6]);
>zipResult : Symbol(zipResult, Decl(typeInferenceWithTupleType.ts, 20, 3))
>zip : Symbol(zip, Decl(typeInferenceWithTupleType.ts, 6, 35))

var zipResultEle = zipResult[0]; // [string, number]
>zipResultEle : Symbol(zipResultEle, Decl(typeInferenceWithTupleType.ts, 21, 3))
>zipResult : Symbol(zipResult, Decl(typeInferenceWithTupleType.ts, 20, 3))
>0 : Symbol(0)

var zipResultEleEle = zipResult[0][0]; // string
>zipResultEleEle : Symbol(zipResultEleEle, Decl(typeInferenceWithTupleType.ts, 22, 3))
>zipResult : Symbol(zipResult, Decl(typeInferenceWithTupleType.ts, 20, 3))
>0 : Symbol(0)
>0 : Symbol(0)