Don't elaborate errors when trying to relate a primitive to a union.

This commit is contained in:
Daniel Rosenwasser committed 2016-03-20 12:30:54 -07:00
1 parent 32178acdfe
commit 323a195db9
1 file changed
+1 -1
+1 -1
View File
@@ -5678,7 +5678,7 @@ namespace ts {
}
}
if (target.flags & TypeFlags.Union) {
if (result = typeRelatedToSomeType(source, <UnionType>target, reportErrors)) {
if (result = typeRelatedToSomeType(source, <UnionType>target, reportErrors && !(source.flags & TypeFlags.Primitive))) {
return result;
}
}