-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <johnniwinther@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
- Loading branch information
Showing
47 changed files
with
876 additions
and
503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.