Don't elaborate errors when trying to relate a primitive to a union.
This commit is contained in:
parent
32178acdfe
commit
323a195db9
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue