Commit graph

4 commits

Author SHA1 Message Date
Paul Berry e933e91aaa Reland "Flow analysis: promote to non-nullable on initialization"
This is a reland of 6a1c54ec30

Original change's description:
> Flow analysis: promote to non-nullable on initialization
>
> When flow analysis encounters a variable declaration of the form `T? x
> = expr;`, if the type of `expr` is `T`, then the variable is
> immediately promoted to type `T`.
>
> Fixes #43099.
>
> Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
> Bug: https://github.com/dart-lang/sdk/issues/43099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

Bug: https://github.com/dart-lang/sdk/issues/43099
Change-Id: I7530bb0f7c24674a7b500558b89d50b35e045aca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166305
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-07 13:14:55 +00:00
Clement Skau b4f49dc255 Revert "Flow analysis: promote to non-nullable on initialization"
This reverts commit 6a1c54ec30.

Reason for revert: Triggers test failure:
https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-linux-debug-x64/8247

Original change's description:
> Flow analysis: promote to non-nullable on initialization
>
> When flow analysis encounters a variable declaration of the form `T? x
> = expr;`, if the type of `expr` is `T`, then the variable is
> immediately promoted to type `T`.
>
> Fixes #43099.
>
> Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
> Bug: https://github.com/dart-lang/sdk/issues/43099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

TBR=paulberry@google.com,scheglov@google.com,rnystrom@google.com,johnniwinther@google.com

Change-Id: I8549b48a734f527194ce11d82235b9d5c6e58185
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/43099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165564
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-10-01 08:41:15 +00:00
Paul Berry 6a1c54ec30 Flow analysis: promote to non-nullable on initialization
When flow analysis encounters a variable declaration of the form `T? x
= expr;`, if the type of `expr` is `T`, then the variable is
immediately promoted to type `T`.

Fixes #43099.

Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
Bug: https://github.com/dart-lang/sdk/issues/43099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-01 01:15:31 +00:00
Robert Nystrom f6b0a70230 Migrate language_2/await to NNBD.
Change-Id: I59ae5b01c00f3bebda0ba74eb5eb1950ade59925
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137720
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-03-05 18:17:29 +00:00