We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 619658b commit ef40ed1Copy full SHA for ef40ed1
src/compiler/checker.ts
@@ -17833,6 +17833,13 @@ namespace ts {
17833
}
17834
17835
function typeCouldHaveTopLevelSingletonTypes(type: Type): boolean {
17836
+ // Okay, yes, 'boolean' is a union of 'true | false', but that's not useful
17837
+ // in error reporting scenarios. If you need to use this function but that detail matters,
17838
+ // feel free to add a flag.
17839
+ if (type.flags & TypeFlags.Boolean) {
17840
+ return false;
17841
+ }
17842
+
17843
if (type.flags & TypeFlags.UnionOrIntersection) {
17844
return !!forEach((type as IntersectionType).types, typeCouldHaveTopLevelSingletonTypes);
17845
0 commit comments