|
| 1 | +//// [tests/cases/compiler/genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts] //// |
| 2 | + |
| 3 | +=== genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts === |
| 4 | +type Fn<T> = <U extends T>(x: U) => U; |
| 5 | +>Fn : Symbol(Fn, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 0)) |
| 6 | +>T : Symbol(T, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 8)) |
| 7 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 14)) |
| 8 | +>T : Symbol(T, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 8)) |
| 9 | +>x : Symbol(x, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 27)) |
| 10 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 14)) |
| 11 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 14)) |
| 12 | + |
| 13 | +type Concrete1 = <U extends number>(x: U) => U; |
| 14 | +>Concrete1 : Symbol(Concrete1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 38)) |
| 15 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 2, 18)) |
| 16 | +>x : Symbol(x, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 2, 36)) |
| 17 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 2, 18)) |
| 18 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 2, 18)) |
| 19 | + |
| 20 | +type Concrete2 = <U extends string>(x: U) => U; |
| 21 | +>Concrete2 : Symbol(Concrete2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 2, 47)) |
| 22 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 3, 18)) |
| 23 | +>x : Symbol(x, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 3, 36)) |
| 24 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 3, 18)) |
| 25 | +>U : Symbol(U, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 3, 18)) |
| 26 | + |
| 27 | +function f<T1, T2>(t1: Fn<T1>, t2: Fn<T2>, c1: Concrete1, c2: Concrete2) { |
| 28 | +>f : Symbol(f, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 3, 47)) |
| 29 | +>T1 : Symbol(T1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 11)) |
| 30 | +>T2 : Symbol(T2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 14)) |
| 31 | +>t1 : Symbol(t1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 19)) |
| 32 | +>Fn : Symbol(Fn, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 0)) |
| 33 | +>T1 : Symbol(T1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 11)) |
| 34 | +>t2 : Symbol(t2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 30)) |
| 35 | +>Fn : Symbol(Fn, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 0)) |
| 36 | +>T2 : Symbol(T2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 14)) |
| 37 | +>c1 : Symbol(c1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 42)) |
| 38 | +>Concrete1 : Symbol(Concrete1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 0, 38)) |
| 39 | +>c2 : Symbol(c2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 57)) |
| 40 | +>Concrete2 : Symbol(Concrete2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 2, 47)) |
| 41 | + |
| 42 | + // every single one of these assignments should error |
| 43 | + |
| 44 | + t1 = t2; |
| 45 | +>t1 : Symbol(t1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 19)) |
| 46 | +>t2 : Symbol(t2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 30)) |
| 47 | + |
| 48 | + t2 = t1; |
| 49 | +>t2 : Symbol(t2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 30)) |
| 50 | +>t1 : Symbol(t1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 19)) |
| 51 | + |
| 52 | + c1 = c2; |
| 53 | +>c1 : Symbol(c1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 42)) |
| 54 | +>c2 : Symbol(c2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 57)) |
| 55 | + |
| 56 | + c2 = c1; |
| 57 | +>c2 : Symbol(c2, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 57)) |
| 58 | +>c1 : Symbol(c1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 42)) |
| 59 | + |
| 60 | + t1 = c1; |
| 61 | +>t1 : Symbol(t1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 19)) |
| 62 | +>c1 : Symbol(c1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 42)) |
| 63 | + |
| 64 | + c1 = t1; |
| 65 | +>c1 : Symbol(c1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 42)) |
| 66 | +>t1 : Symbol(t1, Decl(genericSignaturesConstrainedToDifferingGenericsNotCompatible.ts, 5, 19)) |
| 67 | +} |
| 68 | + |
0 commit comments