Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Mar 16, 2024
1 parent 3db7f77 commit c4e7828
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<V extends string>(arg: `*${V}*`): V;
// declare const n: number
// let x5 = foo1(`*${n}*` as const);
// declare function foo1<V extends string>(arg: `*${V}*`): V;
// declare const n: number
// let x5 = foo1(`*${n}*` as const);

// type Foo1<T> = T extends `*${infer U}*` ? U : never;
// type Foo1<T> = 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];
Expand Down

0 comments on commit c4e7828

Please sign in to comment.