diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a34f073df3e..1c9de743e9b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10740,7 +10740,7 @@ namespace ts { } } const constraint = getConstraintForRelation(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;