mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Exempt bare 'boolean's from the check.
This commit is contained in:
committed by
Daniel Rosenwasser
parent
619658bd44
commit
ef40ed1ee6
@@ -17833,6 +17833,13 @@ namespace ts {
|
||||
}
|
||||
|
||||
function typeCouldHaveTopLevelSingletonTypes(type: Type): boolean {
|
||||
// Okay, yes, 'boolean' is a union of 'true | false', but that's not useful
|
||||
// in error reporting scenarios. If you need to use this function but that detail matters,
|
||||
// feel free to add a flag.
|
||||
if (type.flags & TypeFlags.Boolean) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type.flags & TypeFlags.UnionOrIntersection) {
|
||||
return !!forEach((type as IntersectionType).types, typeCouldHaveTopLevelSingletonTypes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user