|
| 1 | +=== tests/cases/conformance/types/mapped/mappedTypeOverlappingStringEnumKeys.ts === |
| 2 | +// #37859 |
| 3 | + |
| 4 | +enum TerrestrialAnimalTypes { |
| 5 | +>TerrestrialAnimalTypes : Symbol(TerrestrialAnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 0, 0)) |
| 6 | + |
| 7 | + CAT = "cat", |
| 8 | +>CAT : Symbol(TerrestrialAnimalTypes.CAT, Decl(mappedTypeOverlappingStringEnumKeys.ts, 2, 29)) |
| 9 | + |
| 10 | + DOG = "dog" |
| 11 | +>DOG : Symbol(TerrestrialAnimalTypes.DOG, Decl(mappedTypeOverlappingStringEnumKeys.ts, 3, 14)) |
| 12 | + |
| 13 | +}; |
| 14 | + |
| 15 | +enum AlienAnimalTypes { |
| 16 | +>AlienAnimalTypes : Symbol(AlienAnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 5, 2)) |
| 17 | + |
| 18 | + CAT = "cat", |
| 19 | +>CAT : Symbol(AlienAnimalTypes.CAT, Decl(mappedTypeOverlappingStringEnumKeys.ts, 7, 23)) |
| 20 | + |
| 21 | +}; |
| 22 | + |
| 23 | +type AnimalTypes = TerrestrialAnimalTypes | AlienAnimalTypes; |
| 24 | +>AnimalTypes : Symbol(AnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 9, 2)) |
| 25 | +>TerrestrialAnimalTypes : Symbol(TerrestrialAnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 0, 0)) |
| 26 | +>AlienAnimalTypes : Symbol(AlienAnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 5, 2)) |
| 27 | + |
| 28 | +interface TerrestrialCat { |
| 29 | +>TerrestrialCat : Symbol(TerrestrialCat, Decl(mappedTypeOverlappingStringEnumKeys.ts, 11, 61)) |
| 30 | + |
| 31 | + type: TerrestrialAnimalTypes.CAT; |
| 32 | +>type : Symbol(TerrestrialCat.type, Decl(mappedTypeOverlappingStringEnumKeys.ts, 13, 26)) |
| 33 | +>TerrestrialAnimalTypes : Symbol(TerrestrialAnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 0, 0)) |
| 34 | +>CAT : Symbol(TerrestrialAnimalTypes.CAT, Decl(mappedTypeOverlappingStringEnumKeys.ts, 2, 29)) |
| 35 | + |
| 36 | + address: string; |
| 37 | +>address : Symbol(TerrestrialCat.address, Decl(mappedTypeOverlappingStringEnumKeys.ts, 14, 35)) |
| 38 | +} |
| 39 | + |
| 40 | +interface AlienCat { |
| 41 | +>AlienCat : Symbol(AlienCat, Decl(mappedTypeOverlappingStringEnumKeys.ts, 16, 1)) |
| 42 | + |
| 43 | + type: AlienAnimalTypes.CAT |
| 44 | +>type : Symbol(AlienCat.type, Decl(mappedTypeOverlappingStringEnumKeys.ts, 18, 20)) |
| 45 | +>AlienAnimalTypes : Symbol(AlienAnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 5, 2)) |
| 46 | +>CAT : Symbol(AlienAnimalTypes.CAT, Decl(mappedTypeOverlappingStringEnumKeys.ts, 7, 23)) |
| 47 | + |
| 48 | + planet: string; |
| 49 | +>planet : Symbol(AlienCat.planet, Decl(mappedTypeOverlappingStringEnumKeys.ts, 19, 28)) |
| 50 | +} |
| 51 | + |
| 52 | +type Cats = TerrestrialCat | AlienCat; |
| 53 | +>Cats : Symbol(Cats, Decl(mappedTypeOverlappingStringEnumKeys.ts, 21, 1)) |
| 54 | +>TerrestrialCat : Symbol(TerrestrialCat, Decl(mappedTypeOverlappingStringEnumKeys.ts, 11, 61)) |
| 55 | +>AlienCat : Symbol(AlienCat, Decl(mappedTypeOverlappingStringEnumKeys.ts, 16, 1)) |
| 56 | + |
| 57 | +type CatMap = { |
| 58 | +>CatMap : Symbol(CatMap, Decl(mappedTypeOverlappingStringEnumKeys.ts, 23, 38)) |
| 59 | + |
| 60 | + [V in AnimalTypes]: Extract<Cats, { type: V }>[] |
| 61 | +>V : Symbol(V, Decl(mappedTypeOverlappingStringEnumKeys.ts, 26, 3)) |
| 62 | +>AnimalTypes : Symbol(AnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 9, 2)) |
| 63 | +>Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --)) |
| 64 | +>Cats : Symbol(Cats, Decl(mappedTypeOverlappingStringEnumKeys.ts, 21, 1)) |
| 65 | +>type : Symbol(type, Decl(mappedTypeOverlappingStringEnumKeys.ts, 26, 37)) |
| 66 | +>V : Symbol(V, Decl(mappedTypeOverlappingStringEnumKeys.ts, 26, 3)) |
| 67 | + |
| 68 | +}; |
| 69 | + |
| 70 | +const catMap: CatMap = { |
| 71 | +>catMap : Symbol(catMap, Decl(mappedTypeOverlappingStringEnumKeys.ts, 29, 5)) |
| 72 | +>CatMap : Symbol(CatMap, Decl(mappedTypeOverlappingStringEnumKeys.ts, 23, 38)) |
| 73 | + |
| 74 | + cat: [ |
| 75 | +>cat : Symbol(cat, Decl(mappedTypeOverlappingStringEnumKeys.ts, 29, 24)) |
| 76 | + |
| 77 | + { type: TerrestrialAnimalTypes.CAT, address: "" }, |
| 78 | +>type : Symbol(type, Decl(mappedTypeOverlappingStringEnumKeys.ts, 31, 5)) |
| 79 | +>TerrestrialAnimalTypes.CAT : Symbol(TerrestrialAnimalTypes.CAT, Decl(mappedTypeOverlappingStringEnumKeys.ts, 2, 29)) |
| 80 | +>TerrestrialAnimalTypes : Symbol(TerrestrialAnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 0, 0)) |
| 81 | +>CAT : Symbol(TerrestrialAnimalTypes.CAT, Decl(mappedTypeOverlappingStringEnumKeys.ts, 2, 29)) |
| 82 | +>address : Symbol(address, Decl(mappedTypeOverlappingStringEnumKeys.ts, 31, 39)) |
| 83 | + |
| 84 | + { type: AlienAnimalTypes.CAT, planet: "" } |
| 85 | +>type : Symbol(type, Decl(mappedTypeOverlappingStringEnumKeys.ts, 32, 5)) |
| 86 | +>AlienAnimalTypes.CAT : Symbol(AlienAnimalTypes.CAT, Decl(mappedTypeOverlappingStringEnumKeys.ts, 7, 23)) |
| 87 | +>AlienAnimalTypes : Symbol(AlienAnimalTypes, Decl(mappedTypeOverlappingStringEnumKeys.ts, 5, 2)) |
| 88 | +>CAT : Symbol(AlienAnimalTypes.CAT, Decl(mappedTypeOverlappingStringEnumKeys.ts, 7, 23)) |
| 89 | +>planet : Symbol(planet, Decl(mappedTypeOverlappingStringEnumKeys.ts, 32, 33)) |
| 90 | + |
| 91 | + ], |
| 92 | + dog: [] as never[] |
| 93 | +>dog : Symbol(dog, Decl(mappedTypeOverlappingStringEnumKeys.ts, 33, 4)) |
| 94 | + |
| 95 | +}; |
| 96 | + |
0 commit comments