diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 44bbfbc9ad5..846bb288d6b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4489,6 +4489,8 @@ namespace ts { const members: SymbolTable = createMap(); let stringIndexInfo: IndexInfo; let numberIndexInfo: IndexInfo; + // Resolve upfront such that recursive references see an empty object type. + setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, undefined, undefined); // In { [P in K]: T }, we refer to P as the type parameter type, K as the constraint type, // and T as the template type. const typeParameter = getTypeParameterFromMappedType(type);