[dart-lang/sdk] c116ea: [flow analysis] In tests, improve plumbing of flow...

0 views
Skip to first unread message

Paul Berry

unread,
Feb 23, 2026, 6:47:58 PM (13 hours ago) Feb 23
to com...@dartlang.org
Branch: refs/heads/main
Home: https://github.com/dart-lang/sdk
Commit: c116ea6c55509cd523e44601374bcaa218fa1a09
https://github.com/dart-lang/sdk/commit/c116ea6c55509cd523e44601374bcaa218fa1a09
Author: Paul Berry <paul...@google.com>
Date: 2026-02-23 (Mon, 23 Feb 2026)

Changed paths:
M pkg/_fe_analyzer_shared/test/mini_ast.dart

Log Message:
-----------
[flow analysis] In tests, improve plumbing of flow analysis info.

Makes the following updates to the mini_ast used for flow analysis
testing:

- When visiting a `Write` node, the flow analysis expression info is
pulled directly from the analysis result of the RHS and passed to
`_visitWrite`, rather than deferring to `_visitWrite` to look it up
using `getFlowAnalysisInfo`.

- When computing the promoted type or the promotion chain of a
`Property` node, the flow analysis expression info is pulled
directly from the analysis result of the target (by
`_computeMemberAndFlowAnalysisInfo`) rather than looking it up using
`getFlowAnalysisInfo`.

- When creating the guard variable for a null-aware property access or
method call, the result of analyzing the target is passed directly
to `createNullAwareGuard`, allowing it to obtain the flow analysis
expression info directly rather than fetching it from
`getFlowAnalysisInfo`. The modified expression info for the
null-checked target is then returned directly back to the caller
using another analysis result, rather than requiring the caller to
look it up using another call to `getFlowAnalysisInfo`.

These changes pave the way for removing the `getFlowAnalysisInfo` and
`storeFlowAnalysisInfo` methods from mini_ast, along with the map they
use for storage.

Change-Id: I6a6a6964d4533c16f622f08b302a7f62c959b58f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482562
Reviewed-by: Chloe Stefantsova <cstefa...@google.com>
Commit-Queue: Paul Berry <paul...@google.com>



To unsubscribe from these emails, change your notification settings at https://github.com/dart-lang/sdk/settings/notifications

Paul Berry

unread,
Feb 23, 2026, 8:33:22 PM (11 hours ago) Feb 23
to com...@dartlang.org
Branch: refs/heads/lkgr
Commit: f7edf6a7f7fb6e45488ae2e0645579d25cc9e6dd
https://github.com/dart-lang/sdk/commit/f7edf6a7f7fb6e45488ae2e0645579d25cc9e6dd
Author: Paul Berry <paul...@google.com>
Date: 2026-02-23 (Mon, 23 Feb 2026)

Changed paths:
M pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_mini_ast.dart
M pkg/_fe_analyzer_shared/test/mini_ast.dart

Log Message:
-----------
[flow analysis] Remove _flowAnalysisInfoMap from mini_ast test harness.

Removes the `_flowAnalysisInfoMap` field from the `Harness` class,
which serves as the test harness for the mini_ast used in flow
analysis testing, along with the methods `getFlowAnalysisInfo` and
`storeFlowAnalysisInfo` that did map lookups. Calls to
`getFlowAnalysisInfo` are replaced with logic that pulls the flow
analysis expression info directly from the expression analysis result,
and calls to `storeFlowAnalysisInfo` are dropped (since they are no
longer needed).

Also, the assertion is dropped from `dispatchExpression` that used to
verify that the information stored in the map matched the information
stored in the expression analysis result.

Change-Id: I6a6a69643e0345a1f5ef84f09340119b56bfed12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482580
Reviewed-by: Chloe Stefantsova <cstefa...@google.com>
Commit-Queue: Paul Berry <paul...@google.com>


Compare: https://github.com/dart-lang/sdk/compare/bf5756b5a039...f7edf6a7f7fb
Reply all
Reply to author
Forward
0 new messages