-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
When the Flutter engine is built internally in google3, a few Dart libraries are built in such a way that (a) the Dart language version is assumed to be the latest bleeding-edge version, ignoring SDK constraints in pubspec.yaml files, and (b) warnings such as "unnecessary !" will cause a build failure.
Therefore, in order to avoid build failures when we enable private field promotion in the bleeding-edge version of the dart SDK, we need to do one of the following things:
- Track down and fix the build rules for the affected Dart libraries, and modify them to assume Dart language version 3.0.
- Insert
// @dart=3.0comments in the affected Dart libraries, to force the build tools to assume language version 3.0. - Modify the code in such a way that no warnings will occur when private field promotion is enabled.
I believe that the third option is the most convenient approach, considering that (a) a very small amount of engine code is affected, and (b) this ensures that no further changes to these libraries will be required once the bleeding-edge version of the Dart SDK gets fully released, and the SDK constraints in pubspec.yaml files are updated.
I will follow up with a PR shortly.