mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Elt access assignment uses declared, not narrowed type (#27574)
I forgot to do this in #26424. Fixes #27557 Fixes #27412
This commit is contained in:
@@ -9305,7 +9305,9 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
const propType = getTypeOfSymbol(prop);
|
||||
return accessExpression ? getFlowTypeOfReference(accessExpression, propType) : propType;
|
||||
return accessExpression && getAssignmentTargetKind(accessExpression) !== AssignmentKind.Definite ?
|
||||
getFlowTypeOfReference(accessExpression, propType) :
|
||||
propType;
|
||||
}
|
||||
if (isTupleType(objectType)) {
|
||||
const restType = getRestTypeOfTupleType(objectType);
|
||||
|
||||
Reference in New Issue
Block a user