Skip to content

Flutter engine needs modifications to prepare for private field promotion. #131198

@stereotype441

Description

@stereotype441

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:

  1. Track down and fix the build rules for the affected Dart libraries, and modify them to assume Dart language version 3.0.
  2. Insert // @dart=3.0 comments in the affected Dart libraries, to force the build tools to assume language version 3.0.
  3. 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.

Metadata

Metadata

Assignees

Labels

engineflutter/engine related. See also e: labels.team-engineOwned by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions