Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fix engine in preparation for implementing https://github.com/dart-lang/language/issues/1274 #23131

Merged
merged 1 commit into from
Dec 17, 2020

Conversation

stereotype441
Copy link
Contributor

@stereotype441 stereotype441 commented Dec 17, 2020

Description

When dart-lang/language#1274 (Infer
non-nullability from local boolean variables) is implemented, flow
analysis will detect that code like this no longer needs to perform a
null check:

final bool hasIdentityTransform =
    transform == null || isIdentityFloat32ListTransform(transform);
...
if (!hasIdentityTransform) {
  ... transform! ... // Null check unnecessary
}

To avoid a build failure due to the unnecessary null check, we need to
temporarily write it in a way that we can ignore it. Once the feature
is complete and rolled into flutter, I'll remove the null check
entirely.

Related Issues

Tests

N/A

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the contributor guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the C++, Objective-C, Java style guides for the engine.
  • I read the tree hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Reviewer Checklist

Breaking Change

Did any tests fail when you ran them? Please read handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

When dart-lang/language#1274 (Infer
non-nullability from local boolean variables) is implemented, flow
analysis will detect that code like this no longer needs to perform a
null check:

    final bool hasIdentityTransform =
        transform == null || isIdentityFloat32ListTransform(transform);
    ...
    if (!hasIdentityTransform) {
      ... transform! ... // Null check unnecessary
    }

To avoid a build failure due to the unnecessary null check, we need to
temporarily write it in a way that we can ignore it.  Once the feature
is complete and rolled into flutter, I'll remove the null check
entirely.
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@Hixie
Copy link
Contributor

Hixie commented Dec 17, 2020

Test exempt.

@stereotype441 stereotype441 requested review from goderbauer and removed request for yjbanov December 17, 2020 19:43
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stereotype441 stereotype441 merged commit 2ef2c86 into flutter:master Dec 17, 2020
@stereotype441 stereotype441 deleted the b-1274-30 branch December 17, 2020 19:59
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 17, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 17, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
zanderso pushed a commit to flutter/flutter that referenced this pull request Dec 18, 2020
* c608b07 bump fuchsia toolchain to clang-12 (flutter/engine#23067)

* 8a3e9a2 fix crash in FontCollection::init() when FontFamily is empty (flutter/engine#23019)

* 95ba5ca Roll Skia from 6f31e27f1e29 to 85fa75616dfe (7 revisions) (flutter/engine#23118)

* 50e7d89 [web] Switch web-render option default to auto (flutter/engine#23090)

* 8854520 Roll Skia from 85fa75616dfe to d6f2338ab194 (3 revisions) (flutter/engine#23119)

* acad21c [web] Tests for rich paragraph DOM (flutter/engine#23097)

* 27ebbc4 Rename PointerState.isDown as per style guide (flutter/engine#23120)

* 19950f5 [web] Rich paragraph getBoxesForRange (flutter/engine#23098)

* 581acbe Roll Skia from d6f2338ab194 to 1d89532d5988 (1 revision) (flutter/engine#23122)

* 540b191 Roll Fuchsia Mac SDK from acylwa3i4... to chLTYsKMR... (flutter/engine#23125)

* 3b52edf Roll Skia from 1d89532d5988 to 7839f66540b6 (1 revision) (flutter/engine#23126)

* 6b25350 Roll Fuchsia Linux SDK from TIKHoiQyP... to wu6yV-_BL... (flutter/engine#23127)

* 9c72085 Roll Skia from 7839f66540b6 to 20f1b3462878 (1 revision) (flutter/engine#23129)

* ee323d0 Roll Skia from 20f1b3462878 to 995f0366bd21 (2 revisions) (flutter/engine#23132)

* 625aa69 Roll Skia from 995f0366bd21 to b64da3907f76 (1 revision) (flutter/engine#23135)

* affc421 Roll Skia from b64da3907f76 to 81da68af2ecf (7 revisions) (flutter/engine#23142)

* 9a6a31e Roll Fuchsia Mac SDK from chLTYsKMR... to RDUxjnng0... (flutter/engine#23143)

* 78657ed Added golden test to make sure that spawn engines work. (flutter/engine#23066)

* bb9cac2 Roll Fuchsia Linux SDK from wu6yV-_BL... to _l04etgVd... (flutter/engine#23145)

* 51c9ae9 Add --strict_null_safety_checks to the Dart flag allowlist (flutter/engine#23144)

* 76310c4 Add missing sdk constriant in pubspec.yaml files. (flutter/engine#23124)

* 6e54f0d [fuchsia] Add wrapper for zx_clock_get_monotonic. (flutter/engine#23128)

* ade75e0 [web] Rich paragraph getPositionForOffset (flutter/engine#23133)

* 2ef2c86 Fix engine in preparation for implementing dart-lang/language#1274 (flutter/engine#23131)

* 9384324 Update android_lint deps (flutter/engine#23151)

* ea4bb2a Roll Skia from 81da68af2ecf to 7b920446a8fc (14 revisions) (flutter/engine#23152)

* 4b5e4e6 Make it easier to turn on Xcode symlinks (flutter/engine#23150)

* 325f069 Roll fuchsia toolchain (flutter/engine#23155)

* 05704d3 Use include for C/C++ headers in darwin/macos (flutter/engine#23035)

* 8d3d69b Turned no malloc scribble and randomized the tests. (flutter/engine#23014)

* 418cc48 Fix macOS crash when modifier keys pressed. (flutter/engine#23154)

* a8c360d Update FlutterPlatformViewsTests (flutter/engine#23158)

* d941aef [web] Rich text painting on bitmap canvas (flutter/engine#23136)

* 67cb0f3 Revert "[web] Switch web-render option default to auto (#23090)" (flutter/engine#23161)

* c4b48c5 Roll Skia from 7b920446a8fc to dfc880bd9ba0 (14 revisions) (flutter/engine#23164)

* de1de9d Disable FlutterPluginAppLifeCycleDelegateTest testWillResignActive (flutter/engine#23166)
gspencergoog pushed a commit to gspencergoog/engine that referenced this pull request Jan 5, 2021
…lutter#23131)

When dart-lang/language#1274 (Infer
non-nullability from local boolean variables) is implemented, flow
analysis will detect that code like this no longer needs to perform a
null check:

    final bool hasIdentityTransform =
        transform == null || isIdentityFloat32ListTransform(transform);
    ...
    if (!hasIdentityTransform) {
      ... transform! ... // Null check unnecessary
    }

To avoid a build failure due to the unnecessary null check, we need to
temporarily write it in a way that we can ignore it.  Once the feature
is complete and rolled into flutter, I'll remove the null check
entirely.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants