Files
sdk/pkg/_fe_analyzer_shared/test
Paul Berry 2e5399e39e [flow analysis] Change the API for logical not to use ExpressionInfo.
Changes the API of `FlowAnalysis.logicalNot_end` so that it accepts an
`ExpressionInfo` object describing the subexpression, and returns an
`ExpressionInfo` object describing the whole expression; the client is
responsible for getting the `ExpressionInfo` object prior to the call
and storing it afterwards.

In the process of making this change, I noticed the opportunity to
make a small optimization: when the subexpression of a logical not
expression has no associated `ExpressionInfo`, it is not necessary to
create an `ExpressionInfo` for the whole logical not expression.

Eventually all flow analysis APIs will be adjusted in a similar way,
so that the clients become fully responsible for keeping track of the
association between expressions and `ExpressionInfo` objects. Once
that is done, clients will be free to maintain the mapping between
expressions and `ExpressionInfo` objects in whatever way they see fit,
they won't be required to store the assocation in a map.

Change-Id: I6a6a6964313da85a94a52c5b59b663568058d84d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471981
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-01-14 09:34:24 -08:00
..