@@ -5,74 +5,104 @@ class Unconstrained<T> {
5
5
6
6
value: T;
7
7
>value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
8
+ >T : Symbol(T, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 20))
9
+
10
+ read: (value: T) => void;
11
+ >read : Symbol(Unconstrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 1, 13))
12
+ >value : Symbol(value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 2, 11))
8
13
>T : Symbol(T, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 20))
9
14
}
10
15
11
16
declare const x: unknown;
12
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
17
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
13
18
14
19
if (x instanceof Unconstrained) {
15
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
20
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
16
21
>Unconstrained : Symbol(Unconstrained, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 0))
17
22
18
23
x.value.toUpperCase();
19
24
>x.value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
20
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
25
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
21
26
>value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
22
27
23
28
x.value++;
24
29
>x.value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
25
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
30
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
26
31
>value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
27
32
28
33
x.value();
29
34
>x.value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
30
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
35
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
31
36
>value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
32
37
33
38
if (typeof x.value === "string") {
34
39
>x.value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
35
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
40
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
36
41
>value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
37
42
38
43
x.value.toUpperCase();
39
44
>x.value.toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
40
45
>x.value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
41
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
46
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
42
47
>value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
43
48
>toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
44
49
}
45
50
if (typeof x.value === "number") {
46
51
>x.value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
47
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
52
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
48
53
>value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
49
54
50
55
x.value++;
51
56
>x.value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
52
- >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 4 , 13))
57
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5 , 13))
53
58
>value : Symbol(Unconstrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 0, 24))
54
59
}
60
+
61
+ x.read(1);
62
+ >x.read : Symbol(Unconstrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 1, 13))
63
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5, 13))
64
+ >read : Symbol(Unconstrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 1, 13))
65
+
66
+ x.read("foo");
67
+ >x.read : Symbol(Unconstrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 1, 13))
68
+ >x : Symbol(x, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 5, 13))
69
+ >read : Symbol(Unconstrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 1, 13))
55
70
}
56
71
57
72
class Constrained<T extends number> {
58
- >Constrained : Symbol(Constrained, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 17 , 1))
59
- >T : Symbol(T, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 19 , 18))
73
+ >Constrained : Symbol(Constrained, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 21 , 1))
74
+ >T : Symbol(T, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23 , 18))
60
75
61
76
value: T;
62
- >value : Symbol(Constrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 19, 37))
63
- >T : Symbol(T, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 19, 18))
77
+ >value : Symbol(Constrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23, 37))
78
+ >T : Symbol(T, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23, 18))
79
+
80
+ read: (value: T) => void;
81
+ >read : Symbol(Constrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 24, 13))
82
+ >value : Symbol(value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 25, 11))
83
+ >T : Symbol(T, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23, 18))
64
84
}
65
85
66
86
declare const y: unknown;
67
- >y : Symbol(y, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23 , 13))
87
+ >y : Symbol(y, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 28 , 13))
68
88
69
89
if (y instanceof Constrained) {
70
- >y : Symbol(y, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23 , 13))
71
- >Constrained : Symbol(Constrained, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 17 , 1))
90
+ >y : Symbol(y, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 28 , 13))
91
+ >Constrained : Symbol(Constrained, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 21 , 1))
72
92
73
93
y.value++;
74
- >y.value : Symbol(Constrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 19, 37))
75
- >y : Symbol(y, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23, 13))
76
- >value : Symbol(Constrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 19, 37))
94
+ >y.value : Symbol(Constrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23, 37))
95
+ >y : Symbol(y, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 28, 13))
96
+ >value : Symbol(Constrained.value, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 23, 37))
97
+
98
+ y.read(1);
99
+ >y.read : Symbol(Constrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 24, 13))
100
+ >y : Symbol(y, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 28, 13))
101
+ >read : Symbol(Constrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 24, 13))
102
+
103
+ y.read("foo");
104
+ >y.read : Symbol(Constrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 24, 13))
105
+ >y : Symbol(y, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 28, 13))
106
+ >read : Symbol(Constrained.read, Decl(inferInstanceTypeArgumentsAsConstraint.ts, 24, 13))
77
107
}
78
108
0 commit comments