mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 06:35:35 -05:00
Exception for 'any' constraint only applies to type parameters
This commit is contained in:
@@ -10740,7 +10740,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
const constraint = getConstraintForRelation(<TypeParameter>source);
|
||||
if (!constraint || constraint.flags & TypeFlags.Any) {
|
||||
if (!constraint || (source.flags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) {
|
||||
// A type variable with no constraint is not related to the non-primitive object type.
|
||||
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) {
|
||||
errorInfo = saveErrorInfo;
|
||||
|
||||
Reference in New Issue
Block a user