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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
|
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts ===
// checking whether other types are subtypes of type parameters with constraints
class Foo { foo: number; }
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>foo : Symbol(Foo.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 2, 11))
function f<T extends Foo, U extends Foo, V>(t: T, u: U, v: V) {
>f : Symbol(f, Decl(subtypesOfTypeParameterWithConstraints4.ts, 2, 26))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 11))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 25))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 40))
>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 44))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 11))
>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 49))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 25))
>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 55))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 40))
// ok
var r = true ? t : u;
>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints4.ts, 5, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 6, 7))
>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 44))
>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 49))
var r = true ? u : t;
>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints4.ts, 5, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 6, 7))
>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 49))
>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 44))
// ok
var r2 = true ? t : v;
>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints4.ts, 9, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 10, 7))
>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 44))
>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 55))
var r2 = true ? v : t;
>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints4.ts, 9, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 10, 7))
>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 55))
>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 44))
// ok
var r3 = true ? v : u;
>r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints4.ts, 13, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 14, 7))
>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 55))
>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 49))
var r3 = true ? u : v;
>r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints4.ts, 13, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 14, 7))
>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 49))
>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 55))
// ok
var r4 = true ? t : new Foo();
>r4 : Symbol(r4, Decl(subtypesOfTypeParameterWithConstraints4.ts, 17, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 18, 7))
>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 44))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
var r4 = true ? new Foo() : t;
>r4 : Symbol(r4, Decl(subtypesOfTypeParameterWithConstraints4.ts, 17, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 18, 7))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 44))
// ok
var r5 = true ? u : new Foo();
>r5 : Symbol(r5, Decl(subtypesOfTypeParameterWithConstraints4.ts, 21, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 22, 7))
>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 49))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
var r5 = true ? new Foo() : u;
>r5 : Symbol(r5, Decl(subtypesOfTypeParameterWithConstraints4.ts, 21, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 22, 7))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 49))
// ok
var r6 = true ? v : new Foo();
>r6 : Symbol(r6, Decl(subtypesOfTypeParameterWithConstraints4.ts, 25, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 26, 7))
>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 55))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
var r6 = true ? new Foo() : v;
>r6 : Symbol(r6, Decl(subtypesOfTypeParameterWithConstraints4.ts, 25, 7), Decl(subtypesOfTypeParameterWithConstraints4.ts, 26, 7))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints4.ts, 3, 55))
}
class B1<T> {
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 30, 9))
foo: T;
>foo : Symbol(B1.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 30, 13))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 30, 9))
}
class D1<T extends Foo, U extends Foo, V> extends B1<Foo> {
>D1 : Symbol(D1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 32, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 34, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 34, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 34, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
[x: string]: Foo;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 35, 5))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
foo: T; // ok
>foo : Symbol(D1.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 35, 21))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 34, 9))
}
class D2<T extends Foo, U extends Foo, V> extends B1<Foo> {
>D2 : Symbol(D2, Decl(subtypesOfTypeParameterWithConstraints4.ts, 37, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 39, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 39, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 39, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
[x: string]: Foo;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 40, 5))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
foo: U; // ok
>foo : Symbol(D2.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 40, 21))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 39, 23))
}
class D3<T extends Foo, U extends Foo, V> extends B1<Foo> {
>D3 : Symbol(D3, Decl(subtypesOfTypeParameterWithConstraints4.ts, 42, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 44, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 44, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 44, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
[x: string]: Foo;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 45, 5))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
foo: V; // error
>foo : Symbol(D3.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 45, 21))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 44, 38))
}
class D4<T extends Foo, U extends Foo, V> extends B1<T> {
>D4 : Symbol(D4, Decl(subtypesOfTypeParameterWithConstraints4.ts, 47, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 49, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 49, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 49, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 49, 9))
[x: string]: T;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 50, 5))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 49, 9))
foo: T; // ok
>foo : Symbol(D4.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 50, 19))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 49, 9))
}
class D5<T extends Foo, U extends Foo, V> extends B1<T> {
>D5 : Symbol(D5, Decl(subtypesOfTypeParameterWithConstraints4.ts, 52, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 54, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 54, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 54, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 54, 9))
[x: string]: T;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 55, 5))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 54, 9))
foo: U; // error
>foo : Symbol(D5.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 55, 19))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 54, 23))
}
class D6<T extends Foo, U extends Foo, V> extends B1<T> {
>D6 : Symbol(D6, Decl(subtypesOfTypeParameterWithConstraints4.ts, 57, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 59, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 59, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 59, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 59, 9))
[x: string]: T;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 60, 5))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 59, 9))
foo: V; // error
>foo : Symbol(D6.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 60, 19))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 59, 38))
}
class D7<T extends Foo, U extends Foo, V> extends B1<U> {
>D7 : Symbol(D7, Decl(subtypesOfTypeParameterWithConstraints4.ts, 62, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 64, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 64, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 64, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 64, 23))
[x: string]: U;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 65, 5))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 64, 23))
foo: T; // error
>foo : Symbol(D7.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 65, 19))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 64, 9))
}
class D8<T extends Foo, U extends Foo, V> extends B1<U> {
>D8 : Symbol(D8, Decl(subtypesOfTypeParameterWithConstraints4.ts, 67, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 69, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 69, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 69, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 69, 23))
[x: string]: U;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 70, 5))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 69, 23))
foo: U; // ok
>foo : Symbol(D8.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 70, 19))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 69, 23))
}
class D9<T extends Foo, U extends Foo, V> extends B1<U> {
>D9 : Symbol(D9, Decl(subtypesOfTypeParameterWithConstraints4.ts, 72, 1))
>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints4.ts, 74, 9))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 74, 23))
>Foo : Symbol(Foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 0, 0))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 74, 38))
>B1 : Symbol(B1, Decl(subtypesOfTypeParameterWithConstraints4.ts, 28, 1))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 74, 23))
[x: string]: U;
>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints4.ts, 75, 5))
>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints4.ts, 74, 23))
foo: V; // error
>foo : Symbol(D9.foo, Decl(subtypesOfTypeParameterWithConstraints4.ts, 75, 19))
>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints4.ts, 74, 38))
}
|