File tree 1 file changed +11
-4
lines changed 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -4067,10 +4067,17 @@ module ts {
4067
4067
let reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo;
4068
4068
// identity relation does not use apparent type
4069
4069
let sourceOrApparentType = relation === identityRelation ? source : getApparentType(source);
4070
- if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType &&
4071
- (result = objectTypeRelatedTo(sourceOrApparentType, <ObjectType>target, reportStructuralErrors))) {
4072
- errorInfo = saveErrorInfo;
4073
- return result;
4070
+ if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType) {
4071
+ if (result = objectTypeRelatedTo(sourceOrApparentType, <ObjectType>target, reportStructuralErrors)) {
4072
+ errorInfo = saveErrorInfo;
4073
+ return result;
4074
+ }
4075
+ }
4076
+ else if (source.flags & TypeFlags.TypeParameter && sourceOrApparentType.flags & TypeFlags.Union) {
4077
+ if (result = isRelatedTo(sourceOrApparentType, <ObjectType>target, reportStructuralErrors)) {
4078
+ errorInfo = saveErrorInfo;
4079
+ return result;
4080
+ }
4074
4081
}
4075
4082
}
4076
4083
if (reportErrors) {
You can’t perform that action at this time.
0 commit comments