We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e1330e commit ce6fd5eCopy full SHA for ce6fd5e
src/compiler/checker.ts
@@ -10740,7 +10740,7 @@ namespace ts {
10740
}
10741
10742
const constraint = getConstraintForRelation(<TypeParameter>source);
10743
- if (!constraint || constraint.flags & TypeFlags.Any) {
+ if (!constraint || (source.flags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) {
10744
// A type variable with no constraint is not related to the non-primitive object type.
10745
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) {
10746
errorInfo = saveErrorInfo;
0 commit comments