Remove explicit bool type hack.

During the fix for https://github.com/dart-lang/language/issues/1785,
an explicit `bool` type was added to the variable `nullable` to ensure
that it would properly participate in type promotion while the fix was
still being rolled out.  Now that the fix is in place, this explicit
type is no longer needed.

TEST=standard trybots, TAP global presubmit, Golem
Change-Id: Ib81ad436876e576f85c929c205d5831214e6a05a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214821
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2021-12-09 16:34:59 +00:00 committed by Commit Bot
parent ba29ef2927
commit be57c7d5ea
3 changed files with 4 additions and 10 deletions

View file

@ -11,7 +11,7 @@
"constraint, update this by running tools/generate_package_config.dart." "constraint, update this by running tools/generate_package_config.dart."
], ],
"configVersion": 2, "configVersion": 2,
"generated": "2021-11-15T17:34:02.415038", "generated": "2021-12-09T13:52:42.287379",
"generator": "tools/generate_package_config.dart", "generator": "tools/generate_package_config.dart",
"packages": [ "packages": [
{ {
@ -760,7 +760,7 @@
"name": "vm", "name": "vm",
"rootUri": "../pkg/vm", "rootUri": "../pkg/vm",
"packageUri": "lib/", "packageUri": "lib/",
"languageVersion": "2.12" "languageVersion": "2.15"
}, },
{ {
"name": "vm_service", "name": "vm_service",

View file

@ -315,13 +315,7 @@ class AnnotateKernel extends RecursiveVisitor {
Constant? constantValue; Constant? constantValue;
bool isInt = false; bool isInt = false;
// Note: the explicit type `bool` is needed because the checked-in version final nullable = type is NullableType;
// of the CFE that we use for bootstrapping doesn't yet have constructor
// tearoffs enabled, and the fix for bug
// https://github.com/dart-lang/language/issues/1785 only takes effect when
// constructor tearoffs are enabled. TODO(paulberry): remove the type after
// the bootstrap CFE enables constructor tearoffs.
final bool nullable = type is NullableType;
if (nullable) { if (nullable) {
type = type.baseType; type = type.baseType;
} }

View file

@ -4,7 +4,7 @@ description: VM specific Dart code and helper scripts
publish_to: none publish_to: none
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.15.0 <3.0.0'
dependencies: dependencies:
args: ^2.0.0 args: ^2.0.0