mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 15:25:54 -06:00
Exempt bare 'boolean's from the check.
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user