Skip to content

Commit f87ba3f

Browse files
committed
Un-terse getPossiblePropertiesOfUnionType side-effecting code
1 parent ac0af46 commit f87ba3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7475,7 +7475,11 @@ namespace ts {
74757475

74767476
function getPossiblePropertiesOfUnionType(type: UnionType): Symbol[] {
74777477
// The following is for effects - getUnionOrIntersectionProperty will cache all the possible union properties into `type`
7478-
void map(flatMap(type.types, getPropertiesOfType), p => getUnionOrIntersectionProperty(type, p.escapedName));
7478+
for (const t of type.types) {
7479+
for (const p of getPropertiesOfType(t)) {
7480+
void getUnionOrIntersectionProperty(type, p.escapedName);
7481+
}
7482+
}
74797483
// And we can then (uniquely) fetch them out of the cache, instead of as a result of the above call.
74807484
return !type.propertyCache ? emptyArray : arrayFrom(type.propertyCache.values());
74817485
}

0 commit comments

Comments
 (0)