|
| 1 | +=== tests/cases/compiler/parenthesisDoesNotBlockAliasSymbolCreation.ts === |
| 2 | +export type InvalidKeys<K extends string|number|symbol> = { [P in K]? : never }; |
| 3 | +>InvalidKeys : Symbol(InvalidKeys, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 0)) |
| 4 | +>K : Symbol(K, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 24)) |
| 5 | +>P : Symbol(P, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 61)) |
| 6 | +>K : Symbol(K, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 24)) |
| 7 | + |
| 8 | +export type InvalidKeys2<K extends string|number|symbol> = ( |
| 9 | +>InvalidKeys2 : Symbol(InvalidKeys2, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 80)) |
| 10 | +>K : Symbol(K, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 1, 25)) |
| 11 | + |
| 12 | + { [P in K]? : never } |
| 13 | +>P : Symbol(P, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 2, 7)) |
| 14 | +>K : Symbol(K, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 1, 25)) |
| 15 | + |
| 16 | +); |
| 17 | + |
| 18 | +export type A<T> = ( |
| 19 | +>A : Symbol(A, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 3, 2)) |
| 20 | +>T : Symbol(T, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 5, 14)) |
| 21 | + |
| 22 | + T & InvalidKeys<"a"> |
| 23 | +>T : Symbol(T, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 5, 14)) |
| 24 | +>InvalidKeys : Symbol(InvalidKeys, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 0)) |
| 25 | + |
| 26 | +); |
| 27 | +export type A2<T> = ( |
| 28 | +>A2 : Symbol(A2, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 7, 2)) |
| 29 | +>T : Symbol(T, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 8, 15)) |
| 30 | + |
| 31 | + T & InvalidKeys2<"a"> |
| 32 | +>T : Symbol(T, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 8, 15)) |
| 33 | +>InvalidKeys2 : Symbol(InvalidKeys2, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 80)) |
| 34 | + |
| 35 | +); |
| 36 | + |
| 37 | +export const a = null as A<{ x : number }>; |
| 38 | +>a : Symbol(a, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 12, 12)) |
| 39 | +>A : Symbol(A, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 3, 2)) |
| 40 | +>x : Symbol(x, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 12, 28)) |
| 41 | + |
| 42 | +export const a2 = null as A2<{ x : number }>; |
| 43 | +>a2 : Symbol(a2, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 13, 12)) |
| 44 | +>A2 : Symbol(A2, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 7, 2)) |
| 45 | +>x : Symbol(x, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 13, 30)) |
| 46 | + |
| 47 | +export const a3 = null as { x : number } & InvalidKeys<"a">; |
| 48 | +>a3 : Symbol(a3, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 14, 12)) |
| 49 | +>x : Symbol(x, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 14, 27)) |
| 50 | +>InvalidKeys : Symbol(InvalidKeys, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 0)) |
| 51 | + |
| 52 | +export const a4 = null as { x : number } & InvalidKeys2<"a">; |
| 53 | +>a4 : Symbol(a4, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 15, 12)) |
| 54 | +>x : Symbol(x, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 15, 27)) |
| 55 | +>InvalidKeys2 : Symbol(InvalidKeys2, Decl(parenthesisDoesNotBlockAliasSymbolCreation.ts, 0, 80)) |
| 56 | + |
0 commit comments