mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
return baseType in getSubstitutionType when baseType is any (#52573)
This commit is contained in:
@@ -15227,7 +15227,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
|
||||
function getSubstitutionType(baseType: Type, constraint: Type) {
|
||||
if (constraint.flags & TypeFlags.AnyOrUnknown || constraint === baseType) {
|
||||
if (constraint.flags & TypeFlags.AnyOrUnknown || constraint === baseType || baseType.flags & TypeFlags.Any) {
|
||||
return baseType;
|
||||
}
|
||||
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
||||
|
||||
Reference in New Issue
Block a user