|
| 1 | +=== tests/cases/compiler/comparabilityTypeParametersRelatedByUnion.ts === |
| 2 | +class C<T> { |
| 3 | +>C : Symbol(C, Decl(comparabilityTypeParametersRelatedByUnion.ts, 0, 0)) |
| 4 | +>T : Symbol(T, Decl(comparabilityTypeParametersRelatedByUnion.ts, 0, 8)) |
| 5 | + |
| 6 | + constructor(readonly x: T) {} |
| 7 | +>x : Symbol(C.x, Decl(comparabilityTypeParametersRelatedByUnion.ts, 1, 14)) |
| 8 | +>T : Symbol(T, Decl(comparabilityTypeParametersRelatedByUnion.ts, 0, 8)) |
| 9 | + |
| 10 | + good<U extends T>(y: U) { |
| 11 | +>good : Symbol(C.good, Decl(comparabilityTypeParametersRelatedByUnion.ts, 1, 31)) |
| 12 | +>U : Symbol(U, Decl(comparabilityTypeParametersRelatedByUnion.ts, 3, 7)) |
| 13 | +>T : Symbol(T, Decl(comparabilityTypeParametersRelatedByUnion.ts, 0, 8)) |
| 14 | +>y : Symbol(y, Decl(comparabilityTypeParametersRelatedByUnion.ts, 3, 20)) |
| 15 | +>U : Symbol(U, Decl(comparabilityTypeParametersRelatedByUnion.ts, 3, 7)) |
| 16 | + |
| 17 | + if (y === this.x) {} |
| 18 | +>y : Symbol(y, Decl(comparabilityTypeParametersRelatedByUnion.ts, 3, 20)) |
| 19 | +>this.x : Symbol(C.x, Decl(comparabilityTypeParametersRelatedByUnion.ts, 1, 14)) |
| 20 | +>this : Symbol(C, Decl(comparabilityTypeParametersRelatedByUnion.ts, 0, 0)) |
| 21 | +>x : Symbol(C.x, Decl(comparabilityTypeParametersRelatedByUnion.ts, 1, 14)) |
| 22 | + } |
| 23 | + |
| 24 | + bad<U extends T | string>(y: U) { |
| 25 | +>bad : Symbol(C.bad, Decl(comparabilityTypeParametersRelatedByUnion.ts, 5, 3)) |
| 26 | +>U : Symbol(U, Decl(comparabilityTypeParametersRelatedByUnion.ts, 7, 6)) |
| 27 | +>T : Symbol(T, Decl(comparabilityTypeParametersRelatedByUnion.ts, 0, 8)) |
| 28 | +>y : Symbol(y, Decl(comparabilityTypeParametersRelatedByUnion.ts, 7, 28)) |
| 29 | +>U : Symbol(U, Decl(comparabilityTypeParametersRelatedByUnion.ts, 7, 6)) |
| 30 | + |
| 31 | + if (y === this.x) {} |
| 32 | +>y : Symbol(y, Decl(comparabilityTypeParametersRelatedByUnion.ts, 7, 28)) |
| 33 | +>this.x : Symbol(C.x, Decl(comparabilityTypeParametersRelatedByUnion.ts, 1, 14)) |
| 34 | +>this : Symbol(C, Decl(comparabilityTypeParametersRelatedByUnion.ts, 0, 0)) |
| 35 | +>x : Symbol(C.x, Decl(comparabilityTypeParametersRelatedByUnion.ts, 1, 14)) |
| 36 | + } |
| 37 | +} |
| 38 | + |
0 commit comments