mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-15 12:53:27 -05:00
Ensure for-in loop variable is checked
This commit is contained in:
@@ -18321,7 +18321,7 @@ namespace ts {
|
||||
return errorType;
|
||||
}
|
||||
|
||||
const indexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : checkExpression(indexExpression);
|
||||
const indexType = checkExpression(indexExpression);
|
||||
|
||||
if (objectType === errorType || objectType === silentNeverType) {
|
||||
return objectType;
|
||||
@@ -18332,7 +18332,7 @@ namespace ts {
|
||||
return errorType;
|
||||
}
|
||||
|
||||
return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node);
|
||||
return checkIndexedAccessIndexType(getIndexedAccessType(objectType, isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType, node), node);
|
||||
}
|
||||
|
||||
function checkThatExpressionIsProperSymbolReference(expression: Expression, expressionType: Type, reportError: boolean): boolean {
|
||||
|
||||
Reference in New Issue
Block a user