TypeScript/tests/baselines/reference/mappedTypeAsStringTemplate.types
Anders Hejlsberg 97b4063d73
Don't attach declarations to symbols in mapped types with 'as XXX' clauses (#44609)
* Don't attach declarations to symbols in mapped types with 'as XXX' clauses

* Add test (and tweak comment)

Co-authored-by: Eli Barzilay <eli@barzilay.org>
2021-06-16 16:07:33 -07:00

19 lines
517 B
Plaintext

=== tests/cases/compiler/mappedTypeAsStringTemplate.ts ===
// Repro from #44220
function foo<T extends { [K in keyof T as `${Extract<K, string>}y`]: number }>(foox: T) { }
>foo : <T extends { [K in keyof T as `${Extract<K, string>}y`]: number; }>(foox: T) => void
>foox : T
const c = { x: 1 };
>c : { x: number; }
>{ x: 1 } : { x: number; }
>x : number
>1 : 1
foo(c);
>foo(c) : void
>foo : <T extends { [K in keyof T as `${Extract<K, string>}y`]: number; }>(foox: T) => void
>c : { x: number; }