|
| 1 | +=== tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts === |
| 2 | +type Something<T> = { test: string } & (T extends object ? { |
| 3 | +>Something : Symbol(Something, Decl(conditionalTypesExcessProperties.ts, 0, 0)) |
| 4 | +>T : Symbol(T, Decl(conditionalTypesExcessProperties.ts, 0, 15)) |
| 5 | +>test : Symbol(test, Decl(conditionalTypesExcessProperties.ts, 0, 21)) |
| 6 | +>T : Symbol(T, Decl(conditionalTypesExcessProperties.ts, 0, 15)) |
| 7 | + |
| 8 | + arg: T |
| 9 | +>arg : Symbol(arg, Decl(conditionalTypesExcessProperties.ts, 0, 61)) |
| 10 | +>T : Symbol(T, Decl(conditionalTypesExcessProperties.ts, 0, 15)) |
| 11 | + |
| 12 | +} : { |
| 13 | + arg?: undefined |
| 14 | +>arg : Symbol(arg, Decl(conditionalTypesExcessProperties.ts, 2, 5)) |
| 15 | + |
| 16 | + }); |
| 17 | + |
| 18 | +function testFunc2<A extends object>(a: A, sa: Something<A>) { |
| 19 | +>testFunc2 : Symbol(testFunc2, Decl(conditionalTypesExcessProperties.ts, 4, 7)) |
| 20 | +>A : Symbol(A, Decl(conditionalTypesExcessProperties.ts, 6, 19)) |
| 21 | +>a : Symbol(a, Decl(conditionalTypesExcessProperties.ts, 6, 37)) |
| 22 | +>A : Symbol(A, Decl(conditionalTypesExcessProperties.ts, 6, 19)) |
| 23 | +>sa : Symbol(sa, Decl(conditionalTypesExcessProperties.ts, 6, 42)) |
| 24 | +>Something : Symbol(Something, Decl(conditionalTypesExcessProperties.ts, 0, 0)) |
| 25 | +>A : Symbol(A, Decl(conditionalTypesExcessProperties.ts, 6, 19)) |
| 26 | + |
| 27 | + sa = { test: 'hi', arg: a }; // not excess (but currently still not assignable) |
| 28 | +>sa : Symbol(sa, Decl(conditionalTypesExcessProperties.ts, 6, 42)) |
| 29 | +>test : Symbol(test, Decl(conditionalTypesExcessProperties.ts, 7, 10)) |
| 30 | +>arg : Symbol(arg, Decl(conditionalTypesExcessProperties.ts, 7, 22)) |
| 31 | +>a : Symbol(a, Decl(conditionalTypesExcessProperties.ts, 6, 37)) |
| 32 | + |
| 33 | + sa = { test: 'bye', arg: a, arr: a } // excess |
| 34 | +>sa : Symbol(sa, Decl(conditionalTypesExcessProperties.ts, 6, 42)) |
| 35 | +>test : Symbol(test, Decl(conditionalTypesExcessProperties.ts, 8, 10)) |
| 36 | +>arg : Symbol(arg, Decl(conditionalTypesExcessProperties.ts, 8, 23)) |
| 37 | +>a : Symbol(a, Decl(conditionalTypesExcessProperties.ts, 6, 37)) |
| 38 | +>arr : Symbol(arr, Decl(conditionalTypesExcessProperties.ts, 8, 31)) |
| 39 | +>a : Symbol(a, Decl(conditionalTypesExcessProperties.ts, 6, 37)) |
| 40 | +} |
| 41 | + |
0 commit comments