Skip to content

Commit 5a964bd

Browse files
committed
Lookup in both cache if not skipObjectFunctionPropertyAugment
1 parent a252ef9 commit 5a964bd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10997,13 +10997,14 @@ namespace ts {
1099710997
// these partial properties when identifying discriminant properties, but otherwise they are filtered out
1099810998
// and do not appear to be present in the union type.
1099910999
function getUnionOrIntersectionProperty(type: UnionOrIntersectionType, name: __String, skipObjectFunctionPropertyAugment?: boolean): Symbol | undefined {
11000-
const properties = skipObjectFunctionPropertyAugment ?
11001-
type.propertyCacheWithoutObjectFunctionPropertyAugment ||= createSymbolTable() :
11002-
type.propertyCache ||= createSymbolTable();
11003-
let property = properties.get(name);
11000+
let property = type.propertyCacheWithoutObjectFunctionPropertyAugment?.get(name) ||
11001+
!skipObjectFunctionPropertyAugment ? type.propertyCache?.get(name) : undefined;
1100411002
if (!property) {
1100511003
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
1100611004
if (property) {
11005+
const properties = skipObjectFunctionPropertyAugment ?
11006+
type.propertyCacheWithoutObjectFunctionPropertyAugment ||= createSymbolTable() :
11007+
type.propertyCache ||= createSymbolTable();
1100711008
properties.set(name, property);
1100811009
}
1100911010
}

0 commit comments

Comments
 (0)