mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-15 12:53:27 -05:00
Fixed array expression spreads into variadic const calls (#52845)
This commit is contained in:
committed by
GitHub
parent
615a97b1d4
commit
d681520a14
@@ -29712,9 +29712,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
const elementFlags: ElementFlags[] = [];
|
||||
pushCachedContextualType(node);
|
||||
const inDestructuringPattern = isAssignmentTarget(node);
|
||||
const inConstContext = isConstContext(node);
|
||||
const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
|
||||
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
|
||||
const contextualType = getApparentTypeOfContextualType(node, /*contextFlags*/ undefined);
|
||||
const inTupleContext = !!contextualType && someType(contextualType, isTupleLikeType);
|
||||
const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
|
||||
let hasOmittedExpression = false;
|
||||
for (let i = 0; i < elementCount; i++) {
|
||||
const e = elements[i];
|
||||
|
||||
Reference in New Issue
Block a user