|
| 1 | +//// [tests/cases/compiler/declarationEmitExactOptionalPropertyTypesNodeNotReused.ts] //// |
| 2 | + |
| 3 | +=== declarationEmitExactOptionalPropertyTypesNodeNotReused.ts === |
| 4 | +type InexactOptionals<A> = { |
| 5 | +>InexactOptionals : Symbol(InexactOptionals, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 0)) |
| 6 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 7 | + |
| 8 | + [K in keyof A as undefined extends A[K] ? K : never]?: undefined extends A[K] |
| 9 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 1, 5)) |
| 10 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 11 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 12 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 1, 5)) |
| 13 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 1, 5)) |
| 14 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 15 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 1, 5)) |
| 16 | + |
| 17 | + ? A[K] | undefined |
| 18 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 19 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 1, 5)) |
| 20 | + |
| 21 | + : A[K]; |
| 22 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 23 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 1, 5)) |
| 24 | + |
| 25 | +} & { |
| 26 | + [K in keyof A as undefined extends A[K] ? never : K]: A[K]; |
| 27 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 5, 5)) |
| 28 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 29 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 30 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 5, 5)) |
| 31 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 5, 5)) |
| 32 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 22)) |
| 33 | +>K : Symbol(K, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 5, 5)) |
| 34 | + |
| 35 | +}; |
| 36 | + |
| 37 | +type In = { |
| 38 | +>In : Symbol(In, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 6, 2)) |
| 39 | + |
| 40 | + foo?: string; |
| 41 | +>foo : Symbol(foo, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 8, 11)) |
| 42 | + |
| 43 | + bar: number; |
| 44 | +>bar : Symbol(bar, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 9, 17)) |
| 45 | + |
| 46 | + baz: undefined; |
| 47 | +>baz : Symbol(baz, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 10, 16)) |
| 48 | +} |
| 49 | + |
| 50 | +type Out = InexactOptionals<In> |
| 51 | +>Out : Symbol(Out, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 12, 1)) |
| 52 | +>InexactOptionals : Symbol(InexactOptionals, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 0, 0)) |
| 53 | +>In : Symbol(In, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 6, 2)) |
| 54 | + |
| 55 | +const foo = <A = {}>() => (x: Out & A) => null |
| 56 | +>foo : Symbol(foo, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 16, 5)) |
| 57 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 16, 13)) |
| 58 | +>x : Symbol(x, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 16, 27)) |
| 59 | +>Out : Symbol(Out, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 12, 1)) |
| 60 | +>A : Symbol(A, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 16, 13)) |
| 61 | + |
| 62 | +export const baddts = foo() |
| 63 | +>baddts : Symbol(baddts, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 18, 12)) |
| 64 | +>foo : Symbol(foo, Decl(declarationEmitExactOptionalPropertyTypesNodeNotReused.ts, 16, 5)) |
| 65 | + |
0 commit comments