|
| 1 | +//// [tests/cases/compiler/reverseMappedTypePrimitiveConstraintProperty.ts] //// |
| 2 | + |
| 3 | +=== reverseMappedTypePrimitiveConstraintProperty.ts === |
| 4 | +declare function test< |
| 5 | +>test : Symbol(test, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 0, 0)) |
| 6 | + |
| 7 | + T extends { prop: string; nested: { nestedProp: string } }, |
| 8 | +>T : Symbol(T, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 0, 22)) |
| 9 | +>prop : Symbol(prop, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 1, 13)) |
| 10 | +>nested : Symbol(nested, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 1, 27)) |
| 11 | +>nestedProp : Symbol(nestedProp, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 1, 37)) |
| 12 | + |
| 13 | +>(obj: { [K in keyof T]: T[K] }): T; |
| 14 | +>obj : Symbol(obj, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 2, 2)) |
| 15 | +>K : Symbol(K, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 2, 10)) |
| 16 | +>T : Symbol(T, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 0, 22)) |
| 17 | +>T : Symbol(T, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 0, 22)) |
| 18 | +>K : Symbol(K, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 2, 10)) |
| 19 | +>T : Symbol(T, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 0, 22)) |
| 20 | + |
| 21 | +const result = test({ |
| 22 | +>result : Symbol(result, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 4, 5)) |
| 23 | +>test : Symbol(test, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 0, 0)) |
| 24 | + |
| 25 | + prop: "foo", // this one should not widen to string |
| 26 | +>prop : Symbol(prop, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 4, 21)) |
| 27 | + |
| 28 | + nested: { |
| 29 | +>nested : Symbol(nested, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 5, 14)) |
| 30 | + |
| 31 | + nestedProp: "bar", |
| 32 | +>nestedProp : Symbol(nestedProp, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 6, 11)) |
| 33 | + |
| 34 | + }, |
| 35 | + extra: "baz", |
| 36 | +>extra : Symbol(extra, Decl(reverseMappedTypePrimitiveConstraintProperty.ts, 8, 4)) |
| 37 | + |
| 38 | +}); |
| 39 | + |
0 commit comments