diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c8c4d55dab8ce..7324eebfb6a53 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -25446,7 +25446,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { arraysEqual((source as TemplateLiteralType).texts, target.texts) ? map((source as TemplateLiteralType).types, (s, i) => { return isTypeAssignableTo(getBaseConstraintOrType(s), getBaseConstraintOrType(target.types[i])) ? s : getStringLikeTypeForType(s); }) : - inferFromLiteralPartsToTemplateLiteral((source as TemplateLiteralType).texts, (source as TemplateLiteralType).types, target) : + inferFromLiteralPartsToTemplateLiteral((source as TemplateLiteralType).texts, (source as TemplateLiteralType).types, target) : undefined; } @@ -26061,15 +26061,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (source.flags & TypeFlags.StringLiteral && target.flags & TypeFlags.TypeVariable) { const inferenceContext = getInferenceInfoForType(target); // andarist here??? -// declare function foo1(arg: `*${V}*`): V; -// declare const n: number -// let x5 = foo1(`*${n}*` as const); + // declare function foo1(arg: `*${V}*`): V; + // declare const n: number + // let x5 = foo1(`*${n}*` as const); -// type Foo1 = T extends `*${infer U}*` ? U : never; + // type Foo1 = T extends `*${infer U}*` ? U : never; -// type T05 = Foo1<`*${number}*`>; + // type T05 = Foo1<`*${number}*`>; -// type T06 = Foo1<`*${bigint}*`>; + // type T06 = Foo1<`*${bigint}*`>; const constraint = inferenceContext ? getBaseConstraintOfType(inferenceContext.typeParameter) : undefined; if (constraint && !isTypeAny(constraint)) { const constraintTypes = constraint.flags & TypeFlags.Union ? (constraint as UnionType).types : [constraint];