Excluded type unions from the generale source types

This commit is contained in:
Josh Goldberg
2020-04-20 23:32:34 -04:00
parent 035b9ac1c1
commit d12b741004
17 changed files with 57 additions and 57 deletions

View File

@@ -15489,7 +15489,7 @@ namespace ts {
}
}
if (isLiteralType(source) && !isLiteralType(target)) {
if (isLiteralType(source) && !(source.flags & TypeFlags.Union) && !isLiteralType(target) && !(target.flags & TypeFlags.Union)) {
generalizedSourceType = getTypeNameForErrorDisplay(getBaseTypeOfLiteralType(source));
}