diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e9430a058f8..1b5bf8a6541 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4067,10 +4067,17 @@ module ts { let reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; // identity relation does not use apparent type let sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType && - (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { - errorInfo = saveErrorInfo; - return result; + if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType) { + if (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else if (source.flags & TypeFlags.TypeParameter && sourceOrApparentType.flags & TypeFlags.Union) { + if (result = isRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + errorInfo = saveErrorInfo; + return result; + } } } if (reportErrors) {