Revert PR 55371 (#58702)

This commit is contained in:
Gabriela Araujo Britto
2024-05-30 09:53:58 -07:00
committed by GitHub
parent 5df3a107c0
commit b7d8809150
11 changed files with 157 additions and 45 deletions

View File

@@ -18087,16 +18087,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (contains(types, wildcardType)) {
return wildcardType;
}
if (
texts.length === 2 && texts[0] === "" && texts[1] === ""
// literals (including string enums) are stringified below
&& !(types[0].flags & TypeFlags.Literal)
// infer T extends StringLike can't be unwrapped eagerly
&& !types[0].symbol?.declarations?.some(d => d.parent.kind === SyntaxKind.InferType)
&& isTypeAssignableTo(types[0], stringType)
) {
return types[0];
}
const newTypes: Type[] = [];
const newTexts: string[] = [];
let text = texts[0];