Use analyzeExpression for recusion in ResolverVisitor.visitAugmentedInvocation.

This change restores the property that the only caller to
`ExpressionImpl.resolveExpression` is
`ResolverVisitor.dispatchExpression`. This is a useful property
because it means that if there's special logic related to type
contexts that we want to be executed every time the resolver recurses
into an expression, we can safely put that logic in
`ResolverVisitor.dispatchExpression`*.

(*Exception: sometimes the resolver recurses into expressions using
`AstNode.visitChildren`, in which case
`ResolverVisitor.dispatchExpression` is bypassed, but fortunately when
this happens, the context is guaranteed to be `_`, so most
context-related logic is irrelevant.)

Change-Id: Ia39c8564014815551266d6b91d0cc102b5768ba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2024-06-18 20:54:19 +00:00 committed by Commit Queue
parent c47df4ce20
commit 40661a5876

View file

@ -1943,7 +1943,8 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
void resolveArgumentsOfInvalid() {
for (var argument in node.arguments.arguments) {
argument.resolveExpression(this, InvalidTypeImpl.instance);
analyzeExpression(argument, InvalidTypeImpl.instance);
popRewrite();
}
}