|
| 1 | +=== tests/cases/compiler/templateLiteralIntersection.ts === |
| 2 | +// https://github.com/microsoft/TypeScript/issues/48034 |
| 3 | +const a = 'a' |
| 4 | +>a : Symbol(a, Decl(templateLiteralIntersection.ts, 1, 5)) |
| 5 | + |
| 6 | +type A = typeof a |
| 7 | +>A : Symbol(A, Decl(templateLiteralIntersection.ts, 1, 13)) |
| 8 | +>a : Symbol(a, Decl(templateLiteralIntersection.ts, 1, 5)) |
| 9 | + |
| 10 | +type MixA = A & {foo: string} |
| 11 | +>MixA : Symbol(MixA, Decl(templateLiteralIntersection.ts, 3, 17)) |
| 12 | +>A : Symbol(A, Decl(templateLiteralIntersection.ts, 1, 13)) |
| 13 | +>foo : Symbol(foo, Decl(templateLiteralIntersection.ts, 4, 17)) |
| 14 | + |
| 15 | +type OriginA1 = `${A}` |
| 16 | +>OriginA1 : Symbol(OriginA1, Decl(templateLiteralIntersection.ts, 4, 29)) |
| 17 | +>A : Symbol(A, Decl(templateLiteralIntersection.ts, 1, 13)) |
| 18 | + |
| 19 | +type OriginA2 = `${MixA}` |
| 20 | +>OriginA2 : Symbol(OriginA2, Decl(templateLiteralIntersection.ts, 6, 22)) |
| 21 | +>MixA : Symbol(MixA, Decl(templateLiteralIntersection.ts, 3, 17)) |
| 22 | + |
| 23 | +type B = `${typeof a}` |
| 24 | +>B : Symbol(B, Decl(templateLiteralIntersection.ts, 7, 25)) |
| 25 | +>a : Symbol(a, Decl(templateLiteralIntersection.ts, 1, 5)) |
| 26 | + |
| 27 | +type MixB = B & { foo: string } |
| 28 | +>MixB : Symbol(MixB, Decl(templateLiteralIntersection.ts, 9, 22)) |
| 29 | +>B : Symbol(B, Decl(templateLiteralIntersection.ts, 7, 25)) |
| 30 | +>foo : Symbol(foo, Decl(templateLiteralIntersection.ts, 10, 17)) |
| 31 | + |
| 32 | +type OriginB1 = `${B}` |
| 33 | +>OriginB1 : Symbol(OriginB1, Decl(templateLiteralIntersection.ts, 10, 31)) |
| 34 | +>B : Symbol(B, Decl(templateLiteralIntersection.ts, 7, 25)) |
| 35 | + |
| 36 | +type OriginB2 = `${MixB}` |
| 37 | +>OriginB2 : Symbol(OriginB2, Decl(templateLiteralIntersection.ts, 12, 22)) |
| 38 | +>MixB : Symbol(MixB, Decl(templateLiteralIntersection.ts, 9, 22)) |
| 39 | + |
| 40 | +type MixC = { foo: string } & A |
| 41 | +>MixC : Symbol(MixC, Decl(templateLiteralIntersection.ts, 13, 25)) |
| 42 | +>foo : Symbol(foo, Decl(templateLiteralIntersection.ts, 15, 13)) |
| 43 | +>A : Symbol(A, Decl(templateLiteralIntersection.ts, 1, 13)) |
| 44 | + |
| 45 | +type OriginC = `${MixC}` |
| 46 | +>OriginC : Symbol(OriginC, Decl(templateLiteralIntersection.ts, 15, 31)) |
| 47 | +>MixC : Symbol(MixC, Decl(templateLiteralIntersection.ts, 13, 25)) |
| 48 | + |
| 49 | +type MixD<T extends string> = |
| 50 | +>MixD : Symbol(MixD, Decl(templateLiteralIntersection.ts, 17, 24)) |
| 51 | +>T : Symbol(T, Decl(templateLiteralIntersection.ts, 19, 10)) |
| 52 | + |
| 53 | + `${T & { foo: string }}` |
| 54 | +>T : Symbol(T, Decl(templateLiteralIntersection.ts, 19, 10)) |
| 55 | +>foo : Symbol(foo, Decl(templateLiteralIntersection.ts, 20, 12)) |
| 56 | + |
| 57 | +type OriginD = `${MixD<A & { foo: string }> & { foo: string }}`; |
| 58 | +>OriginD : Symbol(OriginD, Decl(templateLiteralIntersection.ts, 20, 28)) |
| 59 | +>MixD : Symbol(MixD, Decl(templateLiteralIntersection.ts, 17, 24)) |
| 60 | +>A : Symbol(A, Decl(templateLiteralIntersection.ts, 1, 13)) |
| 61 | +>foo : Symbol(foo, Decl(templateLiteralIntersection.ts, 21, 28)) |
| 62 | +>foo : Symbol(foo, Decl(templateLiteralIntersection.ts, 21, 47)) |
| 63 | + |
| 64 | +type E = `${A & {}}`; |
| 65 | +>E : Symbol(E, Decl(templateLiteralIntersection.ts, 21, 64)) |
| 66 | +>A : Symbol(A, Decl(templateLiteralIntersection.ts, 1, 13)) |
| 67 | + |
| 68 | +type MixE = E & {} |
| 69 | +>MixE : Symbol(MixE, Decl(templateLiteralIntersection.ts, 23, 21)) |
| 70 | +>E : Symbol(E, Decl(templateLiteralIntersection.ts, 21, 64)) |
| 71 | + |
| 72 | +type OriginE = `${MixE}` |
| 73 | +>OriginE : Symbol(OriginE, Decl(templateLiteralIntersection.ts, 24, 18)) |
| 74 | +>MixE : Symbol(MixE, Decl(templateLiteralIntersection.ts, 23, 21)) |
| 75 | + |
| 76 | +type OriginF = `${A}foo${A}`; |
| 77 | +>OriginF : Symbol(OriginF, Decl(templateLiteralIntersection.ts, 25, 24)) |
| 78 | +>A : Symbol(A, Decl(templateLiteralIntersection.ts, 1, 13)) |
| 79 | +>A : Symbol(A, Decl(templateLiteralIntersection.ts, 1, 13)) |
| 80 | + |
0 commit comments