[Null-aware elements] Implement flow-analysis for null-aware map entires #56786
Labels
area-meta
Cross-cutting, high-level issues (for tracking many other implementation issues, ...).
feature-null-aware-elements
Implementation of the Null-aware elements feature
implementation
Track the implementation of a specific feature (use on area-meta issue, not issues for each tool)
Since the control flow can be changed by the null-aware map entries, the shared flow analysis between the Analyzer and the CFE should be updated accordingly.
Consider the following code:
In
test1
the flow analysis can establish thata
is never anull
, and the value of the null-aware map entry will always be evaluated; therefore, the promotion ofx
toint
induced by the type cast should be visible below the line with the map literal. In contrast with that, intest2
, the flow analysis can't establish thata
will never benull
, which makes it possible that in some casesx as int
will not be executed at all; therefore, the variablex
shouldn't be promoted below the line with the map literal.The text was updated successfully, but these errors were encountered: