Skip to content
Permalink
Browse files
Managing control flow
  • Loading branch information
navya9singh committed Aug 31, 2022
1 parent 9b1cbe0 commit cd312d3076c054cdf9ed6f33c2d3e3995bca92eb
Showing 1 changed file with 4 additions and 3 deletions.
@@ -15589,12 +15589,13 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n")
return accessFlags & AccessFlags.IncludeUndefined ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
}
errorIfWritingToReadonlyIndex(indexInfo);
if (accessFlags & AccessFlags.IncludeUndefined && objectType.symbol && objectType.symbol.flags & (SymbolFlags.RegularEnum | SymbolFlags.ConstEnum)) {
if (indexType.symbol && indexType.flags & TypeFlags.EnumLiteral && getParentOfSymbol(indexType.symbol) === objectType.symbol) {
if (accessFlags & AccessFlags.IncludeUndefined) {
if (objectType.symbol && objectType.symbol.flags & (SymbolFlags.RegularEnum | SymbolFlags.ConstEnum) && (indexType.symbol && indexType.flags & TypeFlags.EnumLiteral && getParentOfSymbol(indexType.symbol) === objectType.symbol)) {
return indexInfo.type;
}
return getUnionType([indexInfo.type, undefinedType]);
}
return accessFlags & AccessFlags.IncludeUndefined ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
return indexInfo.type;
}
if (indexType.flags & TypeFlags.Never) {
return neverType;

0 comments on commit cd312d3

Please sign in to comment.