@@ -1917,6 +1917,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1917
1917
var anyType = createIntrinsicType(TypeFlags.Any, "any");
1918
1918
var autoType = createIntrinsicType(TypeFlags.Any, "any", ObjectFlags.NonInferrableType);
1919
1919
var wildcardType = createIntrinsicType(TypeFlags.Any, "any");
1920
+ var blockedStringType = createIntrinsicType(TypeFlags.Any, "any");
1920
1921
var errorType = createIntrinsicType(TypeFlags.Any, "error");
1921
1922
var unresolvedType = createIntrinsicType(TypeFlags.Any, "unresolved");
1922
1923
var nonInferrableAnyType = createIntrinsicType(TypeFlags.Any, "any", ObjectFlags.ContainsWideningType);
@@ -25719,7 +25720,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
25719
25720
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
25720
25721
if (constraint) {
25721
25722
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
25722
- if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
25723
+ if (!inferredType || inferredType === blockedStringType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
25723
25724
// If the fallback type satisfies the constraint, we pick it. Otherwise, we pick the constraint.
25724
25725
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
25725
25726
}
@@ -38535,7 +38536,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
38535
38536
case SyntaxKind.NoSubstitutionTemplateLiteral:
38536
38537
case SyntaxKind.StringLiteral:
38537
38538
return hasSkipDirectInferenceFlag(node) ?
38538
- wildcardType :
38539
+ blockedStringType :
38539
38540
getFreshTypeOfLiteralType(getStringLiteralType((node as StringLiteralLike).text));
38540
38541
case SyntaxKind.NumericLiteral: {
38541
38542
checkGrammarNumericLiteral(node as NumericLiteral);
0 commit comments