Skip to content

Commit e17ca56

Browse files
committed
add comment
1 parent 3ebc1af commit e17ca56

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22985,15 +22985,17 @@ namespace ts {
2298522985
return reduceLeft((type as UnionType).types, (facts, t) => facts | getTypeFacts(t, ignoreObjects), TypeFacts.None);
2298622986
}
2298722987
if (flags & TypeFlags.Intersection) {
22988-
// // When an intersection contains a primitive type we ignore object type constituents as they are
22989-
// // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
22988+
// When an intersection contains a primitive type we ignore object type constituents as they are
22989+
// presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
2299022990
ignoreObjects ||= maybeTypeOfKind(type, TypeFlags.Primitive);
2299122991
return getIntersectionTypeFacts(type as IntersectionType, ignoreObjects);
2299222992
}
2299322993
return TypeFacts.All;
2299422994
}
2299522995

2299622996
function getIntersectionTypeFacts(type: IntersectionType, ignoreObjects: boolean): TypeFacts {
22997+
// When computing the type facts of an intersection type, certain type facts are computed as `and`
22998+
// and others are computed as `or`.
2299722999
let oredFacts = TypeFacts.None;
2299823000
let andedFacts = TypeFacts.All;
2299923001
for (const t of type.types) {

0 commit comments

Comments
 (0)