TypeScript/tests/baselines/reference/mappedTypeAsStringTemplate.js
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

16 lines
298 B
TypeScript

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