Resolve upfront so recursive mapped types appear empty

This commit is contained in:
Anders Hejlsberg
2016-11-16 06:48:51 -08:00
parent 73ada7a78d
commit c5ab4735ac

View File

@@ -4489,6 +4489,8 @@ namespace ts {
const members: SymbolTable = createMap<Symbol>();
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);