File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5949,6 +5949,12 @@ module ts {
59495949 }
59505950
59515951 function checkSpreadElementExpression(node: SpreadElementExpression, contextualMapper?: TypeMapper): Type {
5952+ // It is usually not safe to call checkExpressionCached if we can be contextually typing.
5953+ // You can tell that we are contextually typing because of the contextualMapper parameter.
5954+ // While it is true that a spread element can have a contextual type, it does not do anything
5955+ // with this type. It is neither affected by it, nor does it propagate it to its operand.
5956+ // So the fact that contextualMapper is passed is not important, because the operand of a spread
5957+ // element is not contextually typed.
59525958 let arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper);
59535959 return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false);
59545960 }
You can’t perform that action at this time.
0 commit comments