|
7 | 7 | (function (cats) { })("lol");
|
8 | 8 | >cats : Symbol(cats, Decl(contextuallyTypedIife.ts, 3, 11))
|
9 | 9 |
|
| 10 | +// Lots of Irritating Superfluous Parentheses |
| 11 | +(function (x) { } ("!")); |
| 12 | +>x : Symbol(x, Decl(contextuallyTypedIife.ts, 5, 11)) |
| 13 | + |
| 14 | +((((function (y) { }))))("-"); |
| 15 | +>y : Symbol(y, Decl(contextuallyTypedIife.ts, 6, 14)) |
| 16 | + |
10 | 17 | // multiple arguments
|
11 | 18 | ((a, b, c) => { })("foo", 101, false);
|
12 |
| ->a : Symbol(a, Decl(contextuallyTypedIife.ts, 5, 2)) |
13 |
| ->b : Symbol(b, Decl(contextuallyTypedIife.ts, 5, 4)) |
14 |
| ->c : Symbol(c, Decl(contextuallyTypedIife.ts, 5, 7)) |
15 |
| - |
16 |
| -// contextually typed parameters. |
17 |
| -(f => f(1))(i => i + 1); |
18 |
| ->f : Symbol(f, Decl(contextuallyTypedIife.ts, 7, 1)) |
19 |
| ->f : Symbol(f, Decl(contextuallyTypedIife.ts, 7, 1)) |
20 |
| ->i : Symbol(i, Decl(contextuallyTypedIife.ts, 7, 12)) |
21 |
| ->i : Symbol(i, Decl(contextuallyTypedIife.ts, 7, 12)) |
| 19 | +>a : Symbol(a, Decl(contextuallyTypedIife.ts, 8, 2)) |
| 20 | +>b : Symbol(b, Decl(contextuallyTypedIife.ts, 8, 4)) |
| 21 | +>c : Symbol(c, Decl(contextuallyTypedIife.ts, 8, 7)) |
22 | 22 |
|
23 | 23 | // default parameters
|
24 | 24 | ((m = 10) => m + 1)(12);
|
25 |
| ->m : Symbol(m, Decl(contextuallyTypedIife.ts, 9, 2)) |
26 |
| ->m : Symbol(m, Decl(contextuallyTypedIife.ts, 9, 2)) |
| 25 | +>m : Symbol(m, Decl(contextuallyTypedIife.ts, 10, 2)) |
| 26 | +>m : Symbol(m, Decl(contextuallyTypedIife.ts, 10, 2)) |
27 | 27 |
|
28 | 28 | ((n = 10) => n + 1)();
|
29 |
| ->n : Symbol(n, Decl(contextuallyTypedIife.ts, 10, 2)) |
30 |
| ->n : Symbol(n, Decl(contextuallyTypedIife.ts, 10, 2)) |
| 29 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 11, 2)) |
| 30 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 11, 2)) |
31 | 31 |
|
32 | 32 | // optional parameters
|
33 | 33 | ((j?) => j + 1)(12);
|
34 |
| ->j : Symbol(j, Decl(contextuallyTypedIife.ts, 12, 2)) |
35 |
| ->j : Symbol(j, Decl(contextuallyTypedIife.ts, 12, 2)) |
| 34 | +>j : Symbol(j, Decl(contextuallyTypedIife.ts, 13, 2)) |
| 35 | +>j : Symbol(j, Decl(contextuallyTypedIife.ts, 13, 2)) |
36 | 36 |
|
37 | 37 | ((k?) => k + 1)();
|
38 |
| ->k : Symbol(k, Decl(contextuallyTypedIife.ts, 13, 2)) |
39 |
| ->k : Symbol(k, Decl(contextuallyTypedIife.ts, 13, 2)) |
| 38 | +>k : Symbol(k, Decl(contextuallyTypedIife.ts, 14, 2)) |
| 39 | +>k : Symbol(k, Decl(contextuallyTypedIife.ts, 14, 2)) |
40 | 40 |
|
41 | 41 | ((l, o?) => l + o)(12); // o should be any
|
42 |
| ->l : Symbol(l, Decl(contextuallyTypedIife.ts, 14, 2)) |
43 |
| ->o : Symbol(o, Decl(contextuallyTypedIife.ts, 14, 4)) |
44 |
| ->l : Symbol(l, Decl(contextuallyTypedIife.ts, 14, 2)) |
45 |
| ->o : Symbol(o, Decl(contextuallyTypedIife.ts, 14, 4)) |
| 42 | +>l : Symbol(l, Decl(contextuallyTypedIife.ts, 15, 2)) |
| 43 | +>o : Symbol(o, Decl(contextuallyTypedIife.ts, 15, 4)) |
| 44 | +>l : Symbol(l, Decl(contextuallyTypedIife.ts, 15, 2)) |
| 45 | +>o : Symbol(o, Decl(contextuallyTypedIife.ts, 15, 4)) |
46 | 46 |
|
47 | 47 | // rest parameters
|
48 | 48 | ((...numbers) => numbers.every(n => n > 0))(5,6,7);
|
49 |
| ->numbers : Symbol(numbers, Decl(contextuallyTypedIife.ts, 16, 2)) |
| 49 | +>numbers : Symbol(numbers, Decl(contextuallyTypedIife.ts, 17, 2)) |
50 | 50 | >numbers.every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
51 |
| ->numbers : Symbol(numbers, Decl(contextuallyTypedIife.ts, 16, 2)) |
| 51 | +>numbers : Symbol(numbers, Decl(contextuallyTypedIife.ts, 17, 2)) |
52 | 52 | >every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
53 |
| ->n : Symbol(n, Decl(contextuallyTypedIife.ts, 16, 31)) |
54 |
| ->n : Symbol(n, Decl(contextuallyTypedIife.ts, 16, 31)) |
| 53 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 17, 31)) |
| 54 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 17, 31)) |
| 55 | + |
| 56 | +((...mixed) => mixed.every(n => !!n))(5,'oops','oh no'); |
| 57 | +>mixed : Symbol(mixed, Decl(contextuallyTypedIife.ts, 18, 2)) |
| 58 | +>mixed.every : Symbol(Array.every, Decl(lib.d.ts, --, --)) |
| 59 | +>mixed : Symbol(mixed, Decl(contextuallyTypedIife.ts, 18, 2)) |
| 60 | +>every : Symbol(Array.every, Decl(lib.d.ts, --, --)) |
| 61 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 18, 27)) |
| 62 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 18, 27)) |
55 | 63 |
|
56 | 64 | ((...noNumbers) => noNumbers.some(n => n > 0))();
|
57 |
| ->noNumbers : Symbol(noNumbers, Decl(contextuallyTypedIife.ts, 17, 2)) |
| 65 | +>noNumbers : Symbol(noNumbers, Decl(contextuallyTypedIife.ts, 19, 2)) |
58 | 66 | >noNumbers.some : Symbol(Array.some, Decl(lib.d.ts, --, --))
|
59 |
| ->noNumbers : Symbol(noNumbers, Decl(contextuallyTypedIife.ts, 17, 2)) |
| 67 | +>noNumbers : Symbol(noNumbers, Decl(contextuallyTypedIife.ts, 19, 2)) |
60 | 68 | >some : Symbol(Array.some, Decl(lib.d.ts, --, --))
|
61 |
| ->n : Symbol(n, Decl(contextuallyTypedIife.ts, 17, 34)) |
62 |
| ->n : Symbol(n, Decl(contextuallyTypedIife.ts, 17, 34)) |
| 69 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 19, 34)) |
| 70 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 19, 34)) |
63 | 71 |
|
64 | 72 | ((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10);
|
65 |
| ->first : Symbol(first, Decl(contextuallyTypedIife.ts, 18, 2)) |
66 |
| ->rest : Symbol(rest, Decl(contextuallyTypedIife.ts, 18, 8)) |
67 |
| ->first : Symbol(first, Decl(contextuallyTypedIife.ts, 18, 2)) |
| 73 | +>first : Symbol(first, Decl(contextuallyTypedIife.ts, 20, 2)) |
| 74 | +>rest : Symbol(rest, Decl(contextuallyTypedIife.ts, 20, 8)) |
| 75 | +>first : Symbol(first, Decl(contextuallyTypedIife.ts, 20, 2)) |
68 | 76 | >rest.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
69 |
| ->rest : Symbol(rest, Decl(contextuallyTypedIife.ts, 18, 8)) |
| 77 | +>rest : Symbol(rest, Decl(contextuallyTypedIife.ts, 20, 8)) |
70 | 78 | >map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
71 |
| ->n : Symbol(n, Decl(contextuallyTypedIife.ts, 18, 43)) |
72 |
| ->n : Symbol(n, Decl(contextuallyTypedIife.ts, 18, 43)) |
| 79 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 20, 43)) |
| 80 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 20, 43)) |
73 | 81 |
|
74 | 82 | // destructuring parameters (with defaults too!)
|
75 | 83 | (({ q }) => q)({ q : 13 });
|
76 |
| ->q : Symbol(q, Decl(contextuallyTypedIife.ts, 20, 3)) |
77 |
| ->q : Symbol(q, Decl(contextuallyTypedIife.ts, 20, 3)) |
78 |
| ->q : Symbol(q, Decl(contextuallyTypedIife.ts, 20, 16)) |
| 84 | +>q : Symbol(q, Decl(contextuallyTypedIife.ts, 22, 3)) |
| 85 | +>q : Symbol(q, Decl(contextuallyTypedIife.ts, 22, 3)) |
| 86 | +>q : Symbol(q, Decl(contextuallyTypedIife.ts, 22, 16)) |
79 | 87 |
|
80 | 88 | (({ p = 14 }) => p)({ p : 15 });
|
81 |
| ->p : Symbol(p, Decl(contextuallyTypedIife.ts, 21, 3)) |
82 |
| ->p : Symbol(p, Decl(contextuallyTypedIife.ts, 21, 3)) |
83 |
| ->p : Symbol(p, Decl(contextuallyTypedIife.ts, 21, 21)) |
| 89 | +>p : Symbol(p, Decl(contextuallyTypedIife.ts, 23, 3)) |
| 90 | +>p : Symbol(p, Decl(contextuallyTypedIife.ts, 23, 3)) |
| 91 | +>p : Symbol(p, Decl(contextuallyTypedIife.ts, 23, 21)) |
84 | 92 |
|
85 | 93 | (({ r = 17 } = { r: 18 }) => r)({r : 19});
|
86 |
| ->r : Symbol(r, Decl(contextuallyTypedIife.ts, 22, 3)) |
87 |
| ->r : Symbol(r, Decl(contextuallyTypedIife.ts, 22, 16)) |
88 |
| ->r : Symbol(r, Decl(contextuallyTypedIife.ts, 22, 3)) |
89 |
| ->r : Symbol(r, Decl(contextuallyTypedIife.ts, 22, 33)) |
| 94 | +>r : Symbol(r, Decl(contextuallyTypedIife.ts, 24, 3)) |
| 95 | +>r : Symbol(r, Decl(contextuallyTypedIife.ts, 24, 16)) |
| 96 | +>r : Symbol(r, Decl(contextuallyTypedIife.ts, 24, 3)) |
| 97 | +>r : Symbol(r, Decl(contextuallyTypedIife.ts, 24, 33)) |
90 | 98 |
|
91 | 99 | (({ u = 22 } = { u: 23 }) => u)();
|
92 |
| ->u : Symbol(u, Decl(contextuallyTypedIife.ts, 23, 3)) |
93 |
| ->u : Symbol(u, Decl(contextuallyTypedIife.ts, 23, 16)) |
94 |
| ->u : Symbol(u, Decl(contextuallyTypedIife.ts, 23, 3)) |
95 |
| - |
| 100 | +>u : Symbol(u, Decl(contextuallyTypedIife.ts, 25, 3)) |
| 101 | +>u : Symbol(u, Decl(contextuallyTypedIife.ts, 25, 16)) |
| 102 | +>u : Symbol(u, Decl(contextuallyTypedIife.ts, 25, 3)) |
96 | 103 |
|
| 104 | +// contextually typed parameters. |
| 105 | +let twelve = (f => f(12))(i => i); |
| 106 | +>twelve : Symbol(twelve, Decl(contextuallyTypedIife.ts, 27, 3)) |
| 107 | +>f : Symbol(f, Decl(contextuallyTypedIife.ts, 27, 14)) |
| 108 | +>f : Symbol(f, Decl(contextuallyTypedIife.ts, 27, 14)) |
| 109 | +>i : Symbol(i, Decl(contextuallyTypedIife.ts, 27, 26)) |
| 110 | +>i : Symbol(i, Decl(contextuallyTypedIife.ts, 27, 26)) |
| 111 | + |
| 112 | +let eleven = (o => o.a(11))({ a: function(n) { return n; } }); |
| 113 | +>eleven : Symbol(eleven, Decl(contextuallyTypedIife.ts, 28, 3)) |
| 114 | +>o : Symbol(o, Decl(contextuallyTypedIife.ts, 28, 14)) |
| 115 | +>o.a : Symbol(a, Decl(contextuallyTypedIife.ts, 28, 29)) |
| 116 | +>o : Symbol(o, Decl(contextuallyTypedIife.ts, 28, 14)) |
| 117 | +>a : Symbol(a, Decl(contextuallyTypedIife.ts, 28, 29)) |
| 118 | +>a : Symbol(a, Decl(contextuallyTypedIife.ts, 28, 29)) |
| 119 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 28, 42)) |
| 120 | +>n : Symbol(n, Decl(contextuallyTypedIife.ts, 28, 42)) |
97 | 121 |
|
0 commit comments