Propagate wildcard types in template literal type construction (#40875)

* Propagate wildcard types in template literal type construction

* Add regression test

* Accept new baselines
This commit is contained in:
Anders Hejlsberg
2020-10-01 10:36:08 -10:00
committed by GitHub
parent b93da6291a
commit 950dad9c29
6 changed files with 83 additions and 0 deletions

View File

@@ -13565,6 +13565,9 @@ namespace ts {
mapType(types[unionIndex], t => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) :
errorType;
}
if (contains(types, wildcardType)) {
return wildcardType;
}
const newTypes: Type[] = [];
const newTexts: string[] = [];
let text = texts[0];