mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-21 16:01:40 -05:00
Revert PR 55371 (#58702)
This commit is contained in:
committed by
GitHub
parent
5df3a107c0
commit
b7d8809150
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user