You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[pkg/vm] Enable const functions during platform const field evaluation.
This allows more complicated field initializers that are written using
immediately invoked closures, like
@pragma("vm:platform-const")
final bool foo = () {
... do some stuff ...
}();
to be properly evaluated by the VM constant evaluator.
Also throws errors at compile time if the annotated member cannot be
evaluated to a constant or if an invalid member (not an
initialized static field or a static getter) is annotated.
TEST=pkg/vm/test/transformations/vm_constant_evaluator_test
Issue: #31969
Issue: #50473
Issue: flutter/flutter#14233
Change-Id: I14be498bb5f7771f0f339baf7d3b1bec7df5903f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348380
Reviewed-by: Johnni Winther <[email protected]>
Commit-Queue: Tess Strickland <[email protected]>
Reviewed-by: Alexander Markov <[email protected]>
0 commit comments