mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Don’t use checkExpressionCached when checking spread element inside a loop
This commit is contained in:
6 files changed
+73
-5
No files matched your search
@@ -20708,7 +20708,7 @@ namespace ts {
|
||||
// of the argument is a tuple type, spread the tuple elements into the argument list. We can
|
||||
// call checkExpressionCached because spread expressions never have a contextual type.
|
||||
const spreadArgument = <SpreadElement>args[length - 1];
|
||||
const type = checkExpressionCached(spreadArgument.expression);
|
||||
const type = flowLoopCount ? checkExpression(spreadArgument.expression) : checkExpressionCached(spreadArgument.expression);
|
||||
if (isTupleType(type)) {
|
||||
const typeArguments = (<TypeReference>type).typeArguments || emptyArray;
|
||||
const restIndex = type.target.hasRestElement ? typeArguments.length - 1 : -1;
|
||||
|
||||
Reference in new issue
Block a user