Skip to content

Commit c5ab473

Browse files
committed
Resolve upfront so recursive mapped types appear empty
1 parent 73ada7a commit c5ab473

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4489,6 +4489,8 @@ namespace ts {
44894489
const members: SymbolTable = createMap<Symbol>();
44904490
let stringIndexInfo: IndexInfo;
44914491
let numberIndexInfo: IndexInfo;
4492+
// Resolve upfront such that recursive references see an empty object type.
4493+
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, undefined, undefined);
44924494
// In { [P in K]: T }, we refer to P as the type parameter type, K as the constraint type,
44934495
// and T as the template type.
44944496
const typeParameter = getTypeParameterFromMappedType(type);

0 commit comments

Comments
 (0)