File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -12919,6 +12919,10 @@ namespace ts {
12919
12919
isUnitType(type);
12920
12920
}
12921
12921
12922
+ function maybeUnitType(type: Type): boolean {
12923
+ return type.flags & TypeFlags.Union ? some((<UnionType>type).types, isUnitType) : isUnitType(type);
12924
+ }
12925
+
12922
12926
function getBaseTypeOfLiteralType(type: Type): Type {
12923
12927
return type.flags & TypeFlags.EnumLiteral ? getBaseTypeOfEnumLiteralType(<LiteralType>type) :
12924
12928
type.flags & TypeFlags.StringLiteral ? stringType :
@@ -14217,7 +14221,7 @@ namespace ts {
14217
14221
const prop = getUnionOrIntersectionProperty(<UnionType>type, name);
14218
14222
if (prop && getCheckFlags(prop) & CheckFlags.SyntheticProperty) {
14219
14223
if ((<TransientSymbol>prop).isDiscriminantProperty === undefined) {
14220
- (<TransientSymbol>prop).isDiscriminantProperty = !!((<TransientSymbol>prop).checkFlags & CheckFlags.HasNonUniformType) && isLiteralType (getTypeOfSymbol(prop));
14224
+ (<TransientSymbol>prop).isDiscriminantProperty = !!((<TransientSymbol>prop).checkFlags & CheckFlags.HasNonUniformType) && maybeUnitType (getTypeOfSymbol(prop));
14221
14225
}
14222
14226
return !!(<TransientSymbol>prop).isDiscriminantProperty;
14223
14227
}
You can’t perform that action at this time.
0 commit comments