[CP] [vm/aot/tfa] Fix handling of type parameter nullability in factory constructors #50412
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
cherry-pick-approved
Label for approved cherrypick request
Commit(s) to merge
8ef9c6a
Target
stable
Prepared changelist for beta/stable
https://dart-review.git.corp.google.com/c/sdk/+/268500
Issue Description
Type flow analysis (part of AOT compiler) ignored nullability of type parameter types (
T?
) in factory constructors. This caused incorrect results of analysis and incorrect optimizations. Only factories of generic classes which use type parameters as nullable (T?
) are affected.What is the fix
Added a new ApplyNullability operation to a summary in order to apply any extra nullability ('?' or '*') on top of the type argument passed to a factory constructor.
Why cherry-pick
This bug caused incorrect optimizations which may lead to a crash or a silent incorrect behavior which may be hard to diagnose.
Risk
low
Issue link(s)
#50392
Extra Info
No response
The text was updated successfully, but these errors were encountered: