[Language] Enable null safety in Dart 2.12.

Closes https://github.com/dart-lang/sdk/issues/22

Change-Id: I662dd17fda0ff62a871314896fbf1dbe220f41de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166790
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
This commit is contained in:
Leaf Petersen 2020-10-29 18:25:56 +00:00 committed by commit-bot@chromium.org
parent 619e388a1d
commit a6faf8f2f9
42 changed files with 153 additions and 269 deletions

View file

@ -124,7 +124,7 @@
"name": "benchmark_harness",
"rootUri": "../third_party/pkg/benchmark_harness",
"packageUri": "lib/",
"languageVersion": "2.10"
"languageVersion": "2.12"
},
{
"name": "boolean_selector",
@ -261,7 +261,7 @@
"name": "ffi",
"rootUri": "../third_party/pkg/ffi",
"packageUri": "lib/",
"languageVersion": "2.10"
"languageVersion": "2.12"
},
{
"name": "fixnum",

View file

@ -1,4 +1,16 @@
## 2.11.0
## 2.12.0
### Language
**Breaking Change** [Null
Safety](https://dart.dev/null-safety/understanding-null-safety) is now enabled
by default in all packages with a lower sdk constraint of 2.12.0 or greater.
Files that are not subject to language versioning (whether because they are not
contained in a pub package, or because the package that they are contained in
has no lower sdk constraint) are treated as opted into to null safety by default
and may report new errors. Pub packages may be opted out of null safety by
setting a min sdk constraint in pubspec.yaml of 2.9.0 or less. Files may be
opted out of null safety by adding `// @dart=2.9` to the beginning of the file.
### Core libraries

View file

@ -8,7 +8,7 @@ part of 'experiments.dart';
/// The current version of the Dart language (or, for non-stable releases, the
/// version of the language currently in the process of being developed).
const _currentVersion = '2.11.0';
const _currentVersion = '2.12.0';
/// A map containing information about all known experimental flags.
final _knownFeatures = <String, ExperimentalFeature>{
@ -98,7 +98,7 @@ class ExperimentalFeatures {
isExpired: IsExpired.non_nullable,
documentation: 'Non Nullable by default',
experimentalReleaseVersion: Version.parse('2.10.0'),
releaseVersion: null,
releaseVersion: Version.parse('2.12.0'),
);
static final nonfunction_type_aliases = ExperimentalFeature(
@ -175,7 +175,7 @@ class IsEnabledByDefault {
static const bool extension_methods = true;
/// Default state of the experiment "non-nullable"
static const bool non_nullable = false;
static const bool non_nullable = true;
/// Default state of the experiment "nonfunction-type-aliases"
static const bool nonfunction_type_aliases = false;

View file

@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//@dart=2.10
//@dart=2.12
/*member: main:ignore*/
void main() {

View file

@ -24,17 +24,17 @@ enum ExperimentalFlag {
}
const Version enableAlternativeInvalidationStrategyVersion =
const Version(2, 11);
const Version(2, 12);
const Version enableConstantUpdate2018Version = const Version(2, 0);
const Version enableControlFlowCollectionsVersion = const Version(2, 0);
const Version enableExtensionMethodsVersion = const Version(2, 6);
const Version enableNonNullableVersion = const Version(2, 11);
const Version enableNonfunctionTypeAliasesVersion = const Version(2, 11);
const Version enableNonNullableVersion = const Version(2, 12);
const Version enableNonfunctionTypeAliasesVersion = const Version(2, 12);
const Version enableSetLiteralsVersion = const Version(2, 0);
const Version enableSpreadCollectionsVersion = const Version(2, 0);
const Version enableTripleShiftVersion = const Version(2, 11);
const Version enableValueClassVersion = const Version(2, 11);
const Version enableVarianceVersion = const Version(2, 11);
const Version enableTripleShiftVersion = const Version(2, 12);
const Version enableValueClassVersion = const Version(2, 12);
const Version enableVarianceVersion = const Version(2, 12);
ExperimentalFlag parseExperimentalFlag(String flag) {
switch (flag) {
@ -69,7 +69,7 @@ const Map<ExperimentalFlag, bool> defaultExperimentalFlags = {
ExperimentalFlag.constantUpdate2018: true,
ExperimentalFlag.controlFlowCollections: true,
ExperimentalFlag.extensionMethods: true,
ExperimentalFlag.nonNullable: false,
ExperimentalFlag.nonNullable: true,
ExperimentalFlag.nonfunctionTypeAliases: false,
ExperimentalFlag.setLiterals: true,
ExperimentalFlag.spreadCollections: true,
@ -93,31 +93,31 @@ const Map<ExperimentalFlag, bool> expiredExperimentalFlags = {
};
const Map<ExperimentalFlag, Version> experimentEnabledVersion = {
ExperimentalFlag.alternativeInvalidationStrategy: const Version(2, 11),
ExperimentalFlag.alternativeInvalidationStrategy: const Version(2, 12),
ExperimentalFlag.constantUpdate2018: const Version(2, 0),
ExperimentalFlag.controlFlowCollections: const Version(2, 0),
ExperimentalFlag.extensionMethods: const Version(2, 6),
ExperimentalFlag.nonNullable: const Version(2, 11),
ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 11),
ExperimentalFlag.nonNullable: const Version(2, 12),
ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 12),
ExperimentalFlag.setLiterals: const Version(2, 0),
ExperimentalFlag.spreadCollections: const Version(2, 0),
ExperimentalFlag.tripleShift: const Version(2, 11),
ExperimentalFlag.valueClass: const Version(2, 11),
ExperimentalFlag.variance: const Version(2, 11),
ExperimentalFlag.tripleShift: const Version(2, 12),
ExperimentalFlag.valueClass: const Version(2, 12),
ExperimentalFlag.variance: const Version(2, 12),
};
const Map<ExperimentalFlag, Version> experimentReleasedVersion = {
ExperimentalFlag.alternativeInvalidationStrategy: const Version(2, 11),
ExperimentalFlag.alternativeInvalidationStrategy: const Version(2, 12),
ExperimentalFlag.constantUpdate2018: const Version(2, 0),
ExperimentalFlag.controlFlowCollections: const Version(2, 0),
ExperimentalFlag.extensionMethods: const Version(2, 6),
ExperimentalFlag.nonNullable: const Version(2, 10),
ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 11),
ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 12),
ExperimentalFlag.setLiterals: const Version(2, 0),
ExperimentalFlag.spreadCollections: const Version(2, 0),
ExperimentalFlag.tripleShift: const Version(2, 11),
ExperimentalFlag.valueClass: const Version(2, 11),
ExperimentalFlag.variance: const Version(2, 11),
ExperimentalFlag.tripleShift: const Version(2, 12),
ExperimentalFlag.valueClass: const Version(2, 12),
ExperimentalFlag.variance: const Version(2, 12),
};
const AllowedExperimentalFlags defaultAllowedExperimentalFlags =

View file

@ -223,6 +223,6 @@ class Generator {
Generator(this.typeParameters, this.beforePlug, this.afterPlug);
String generate(String plug) {
return "${beforePlug}${plug}${afterPlug}";
return "// @dart = 2.9\n${beforePlug}${plug}${afterPlug}";
}
}

View file

@ -9,23 +9,20 @@
// // @dart=2.8
// ^^^^^^^^^^^^
//
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/unversioned_lib.dart:5:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/unversioned_lib.dart:5:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versionedUnallowedPackage; // error
// ^
//
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental and requires language version of 2.9 or higher.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_8_AllowedPackage; // error
// ^
//
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_9_AllowedPackage; // error
// ^
//
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_10_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_10_lib.dart:7:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? versionedAllowedPackage; // error
// ^
//
@ -52,8 +49,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/unversioned_lib.dart:5:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/unversioned_lib.dart:5:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? unversionedLibrary; // error
// ^
//
@ -66,8 +63,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental and requires language version of 2.9 or higher.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_8_Library; // error
// ^
//
@ -80,8 +76,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_9_Library; // error
// ^
//
@ -94,8 +89,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:7:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? versioned_2_10_Library; // error
// ^
//

View file

@ -9,23 +9,20 @@
// // @dart=2.8
// ^^^^^^^^^^^^
//
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/unversioned_lib.dart:5:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/unversioned_lib.dart:5:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versionedUnallowedPackage; // error
// ^
//
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental and requires language version of 2.9 or higher.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_8_AllowedPackage; // error
// ^
//
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_9_AllowedPackage; // error
// ^
//
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_10_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_10_lib.dart:7:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? versionedAllowedPackage; // error
// ^
//
@ -51,8 +48,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/unversioned_lib.dart:5:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/unversioned_lib.dart:5:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? unversionedLibrary; // error
// ^
//
@ -65,8 +62,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental and requires language version of 2.9 or higher.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_8_Library; // error
// ^
//
@ -79,8 +75,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_9_Library; // error
// ^
//
@ -93,8 +88,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:7:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? versioned_2_10_Library; // error
// ^
//

View file

@ -20,8 +20,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/unversioned_lib.dart:5:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/unversioned_lib.dart:5:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? unversionedLibrary; // error
// ^
//
@ -34,8 +34,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental and requires language version of 2.9 or higher.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_8_Library; // error
// ^
//
@ -48,8 +47,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.10 or higher.
// int? versioned_2_9_Library; // error
// ^
//
@ -62,8 +60,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:7:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:7:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? versioned_2_10_Library; // error
// ^
//

View file

@ -2,8 +2,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/null_safety_invalid_experiment.dart:5:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/null_safety_invalid_experiment.dart:5:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? i;
// ^
//

View file

@ -2,8 +2,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/null_safety_invalid_experiment.dart:5:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/null_safety_invalid_experiment.dart:5:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? i;
// ^
//

View file

@ -2,8 +2,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/null_safety_invalid_experiment.dart:5:4: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/null_safety_invalid_experiment.dart:5:4: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// int? i;
// ^
//

View file

@ -2,8 +2,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/null_safety_invalid_experiment_and_language_version.dart:7:4: Error: This requires the null safety language feature, which is experimental and requires language version of 2.10 or higher.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/null_safety_invalid_experiment_and_language_version.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.12 or higher.
// int? i;
// ^
//

View file

@ -2,8 +2,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/null_safety_invalid_experiment_and_language_version.dart:7:4: Error: This requires the null safety language feature, which is experimental and requires language version of 2.10 or higher.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/null_safety_invalid_experiment_and_language_version.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.12 or higher.
// int? i;
// ^
//

View file

@ -2,8 +2,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/null_safety_invalid_experiment_and_language_version.dart:7:4: Error: This requires the null safety language feature, which is experimental and requires language version of 2.10 or higher.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/general/null_safety_invalid_experiment_and_language_version.dart:7:4: Error: This requires the null safety language feature, which requires language version of 2.12 or higher.
// int? i;
// ^
//

View file

@ -1,60 +1,40 @@
library;
library /*isNonNullableByDefault*/;
import self as self;
import "main_lib.dart" as mai;
import "org-dartlang-testcase:///main_lib.dart";
class SubClass extends mai::Class {
synthetic constructor •() → self::SubClass*
synthetic constructor •() → self::SubClass
;
}
static method main() → dynamic
;
library;
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
class SuperClass extends core::Object {
synthetic constructor •() → mai::SuperClass*
synthetic constructor •() → mai::SuperClass
;
method method(covariant core::int* i) → void
method method(covariant core::int i) → void
;
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
}
class Mixin extends core::Object {
synthetic constructor •() → mai::Mixin*
synthetic constructor •() → mai::Mixin
;
method method(core::num* i) → void
method method(core::num i) → void
;
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
}
abstract class _Class&SuperClass&Mixin = mai::SuperClass with mai::Mixin /*isAnonymousMixin*/ {
synthetic constructor •() → mai::_Class&SuperClass&Mixin*
synthetic constructor •() → mai::_Class&SuperClass&Mixin
: super mai::SuperClass::•()
;
forwarding-stub method method(covariant core::num* i) → void
forwarding-stub method method(covariant core::num i) → void
return super.{mai::SuperClass::method}(i);
}
class Class extends mai::_Class&SuperClass&Mixin {
synthetic constructor •() → mai::Class*
synthetic constructor •() → mai::Class
;
}

View file

@ -1,11 +1,11 @@
library;
library /*isNonNullableByDefault*/;
import self as self;
import "main_lib.dart" as mai;
import "org-dartlang-testcase:///main_lib.dart";
class SubClass extends mai::Class {
synthetic constructor •() → self::SubClass*
synthetic constructor •() → self::SubClass
: super mai::Class::•()
;
}
@ -13,51 +13,31 @@ static method main() → dynamic {
new self::SubClass::•();
}
library;
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
class SuperClass extends core::Object {
synthetic constructor •() → mai::SuperClass*
synthetic constructor •() → mai::SuperClass
: super core::Object::•()
;
method method(covariant core::int* i) → void {}
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
method method(covariant core::int i) → void {}
}
class Mixin extends core::Object {
synthetic constructor •() → mai::Mixin*
synthetic constructor •() → mai::Mixin
: super core::Object::•()
;
method method(core::num* i) → void {}
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
method method(core::num i) → void {}
}
abstract class _Class&SuperClass&Mixin = mai::SuperClass with mai::Mixin /*isAnonymousMixin*/ {
synthetic constructor •() → mai::_Class&SuperClass&Mixin*
synthetic constructor •() → mai::_Class&SuperClass&Mixin
: super mai::SuperClass::•()
;
forwarding-stub method method(covariant core::num* i) → void
forwarding-stub method method(covariant core::num i) → void
return super.{mai::SuperClass::method}(i);
}
class Class extends mai::_Class&SuperClass&Mixin {
synthetic constructor •() → mai::Class*
synthetic constructor •() → mai::Class
: super mai::_Class&SuperClass&Mixin::•()
;
}

View file

@ -1,11 +1,11 @@
library;
library /*isNonNullableByDefault*/;
import self as self;
import "main_lib.dart" as mai;
import "org-dartlang-testcase:///main_lib.dart";
class SubClass extends mai::Class {
synthetic constructor •() → self::SubClass*
synthetic constructor •() → self::SubClass
: super mai::Class::•()
;
}
@ -13,51 +13,31 @@ static method main() → dynamic {
new self::SubClass::•();
}
library;
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
class SuperClass extends core::Object {
synthetic constructor •() → mai::SuperClass*
synthetic constructor •() → mai::SuperClass
: super core::Object::•()
;
method method(covariant core::int* i) → void {}
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
method method(covariant core::int i) → void {}
}
class Mixin extends core::Object {
synthetic constructor •() → mai::Mixin*
synthetic constructor •() → mai::Mixin
: super core::Object::•()
;
method method(core::num* i) → void {}
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
method method(core::num i) → void {}
}
abstract class _Class&SuperClass&Mixin = mai::SuperClass with mai::Mixin /*isAnonymousMixin*/ {
synthetic constructor •() → mai::_Class&SuperClass&Mixin*
synthetic constructor •() → mai::_Class&SuperClass&Mixin
: super mai::SuperClass::•()
;
forwarding-stub method method(covariant core::num* i) → void
forwarding-stub method method(covariant core::num i) → void
return super.{mai::SuperClass::method}(i);
}
class Class extends mai::_Class&SuperClass&Mixin {
synthetic constructor •() → mai::Class*
synthetic constructor •() → mai::Class
: super mai::_Class&SuperClass&Mixin::•()
;
}

View file

@ -1,11 +1,11 @@
library;
library /*isNonNullableByDefault*/;
import self as self;
import "main_lib.dart" as mai;
import "org-dartlang-testcase:///main_lib.dart";
class SubClass extends mai::Class {
synthetic constructor •() → self::SubClass*
synthetic constructor •() → self::SubClass
: super mai::Class::•()
;
}
@ -13,51 +13,31 @@ static method main() → dynamic {
new self::SubClass::•();
}
library;
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
class SuperClass extends core::Object {
synthetic constructor •() → mai::SuperClass*
synthetic constructor •() → mai::SuperClass
: super core::Object::•()
;
method method(covariant core::int* i) → void {}
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
method method(covariant core::int i) → void {}
}
class Mixin extends core::Object {
synthetic constructor •() → mai::Mixin*
synthetic constructor •() → mai::Mixin
: super core::Object::•()
;
method method(core::num* i) → void {}
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
method method(core::num i) → void {}
}
abstract class _Class&SuperClass&Mixin = mai::SuperClass with mai::Mixin /*isAnonymousMixin*/ {
synthetic constructor •() → mai::_Class&SuperClass&Mixin*
synthetic constructor •() → mai::_Class&SuperClass&Mixin
: super mai::SuperClass::•()
;
forwarding-stub method method(covariant core::num* i) → void
forwarding-stub method method(covariant core::num i) → void
return super.{mai::SuperClass::method}(i);
}
class Class extends mai::_Class&SuperClass&Mixin {
synthetic constructor •() → mai::Class*
synthetic constructor •() → mai::Class
: super mai::_Class&SuperClass&Mixin::•()
;
}

View file

@ -1,11 +1,11 @@
library;
library /*isNonNullableByDefault*/;
import self as self;
import "main_lib.dart" as mai;
import "org-dartlang-testcase:///main_lib.dart";
class SubClass extends mai::Class {
synthetic constructor •() → self::SubClass*
synthetic constructor •() → self::SubClass
: super mai::Class::•()
;
}
@ -13,51 +13,31 @@ static method main() → dynamic {
new self::SubClass::•();
}
library;
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
class SuperClass extends core::Object {
synthetic constructor •() → mai::SuperClass*
synthetic constructor •() → mai::SuperClass
: super core::Object::•()
;
method method(covariant core::int* i) → void {}
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
method method(covariant core::int i) → void {}
}
class Mixin extends core::Object {
synthetic constructor •() → mai::Mixin*
synthetic constructor •() → mai::Mixin
: super core::Object::•()
;
method method(core::num* i) → void {}
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
abstract member-signature method toString() → core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
method method(core::num i) → void {}
}
abstract class _Class&SuperClass&Mixin = mai::SuperClass with mai::Mixin /*isAnonymousMixin*/ {
synthetic constructor •() → mai::_Class&SuperClass&Mixin*
synthetic constructor •() → mai::_Class&SuperClass&Mixin
: super mai::SuperClass::•()
;
forwarding-stub method method(covariant core::num* i) → void
forwarding-stub method method(covariant core::num i) → void
return super.{mai::SuperClass::method}(i);
}
class Class extends mai::_Class&SuperClass&Mixin {
synthetic constructor •() → mai::Class*
synthetic constructor •() → mai::Class
: super mai::_Class&SuperClass&Mixin::•()
;
}

View file

@ -2,8 +2,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/regress/issue_31180.dart:6:15: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/regress/issue_31180.dart:6:15: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// return null?[1];
// ^
//

View file

@ -2,8 +2,8 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/regress/issue_31180.dart:6:15: Error: This requires the null safety language feature, which is experimental.
// You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
// pkg/front_end/testcases/regress/issue_31180.dart:6:15: Error: This requires the 'non-nullable' language feature to be enabled.
// The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-non-nullable' command line option is passed.
// return null?[1];
// ^
//

View file

@ -9,4 +9,4 @@
import "ast.dart";
Version defaultLanguageVersion = const Version(2, 11);
Version defaultLanguageVersion = const Version(2, 12);

View file

@ -28,8 +28,6 @@ List<String> _experimentsArgument(
var experiments = {
...configuration.experiments,
...testFile.experiments,
if (configuration.nnbdMode != NnbdMode.legacy)
'non-nullable',
};
if (experiments.isEmpty) {
return const [];

View file

@ -71,7 +71,7 @@ main() {
.writeLibraryFile(component.mainMethod.enclosingLibrary);
expect(
buffer.toString(),
equals('library;\n'
equals('library /*isNonNullableByDefault*/;\n'
'import self as self;\n'
'\n'
'static method main() → dynamic {}\n'));
@ -93,7 +93,7 @@ main() {
.writeLibraryFile(component.mainMethod.enclosingLibrary);
expect(
buffer.toString(),
equals('library;\n'
equals('library /*isNonNullableByDefault*/;\n'
'import self as self;\n'
'\n'
'static method main() → dynamic {}\n'));

View file

@ -220,7 +220,7 @@ const char* TestCase::GetTestLib(const char* url) {
}
bool TestCase::IsNNBD() {
return KernelIsolate::GetExperimentalFlag("non-nullable");
return !KernelIsolate::GetExperimentalFlag("no-non-nullable");
}
#ifndef PRODUCT

View file

@ -4,7 +4,7 @@
// This version should continue to opt in to null safety in purpetuity (or at
// least until Dart 3), when the experiment is enabled.
// @dart = 2.10
// @dart = 2.12
void main() {
// This should be an error since we are opted in.

View file

@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// @dart = 2.10
// This library establishes an opted in class hierarchy which has a single
// non-generic top element, with a generic element below it, and a null safety
// specific instantantiation of the generic below that. This is used to test

View file

@ -4,8 +4,6 @@
// Requirements=nnbd-weak
// @dart = 2.10
// Test that upper bound computations which rely on the computations of the
// cardinality of the superinterface sets define those sets without erasing or
// modifying the superinterfaces.

View file

@ -4,12 +4,12 @@
{
"name": "foo",
"rootUri": "../packages/foo",
"languageVersion": "2.10"
"languageVersion": "2.12"
},
{
"name": "bar",
"rootUri": "../packages/bar",
"languageVersion": "2.10"
"languageVersion": "2.12"
}
]
}

View file

@ -4,12 +4,12 @@
{
"name": "foo",
"rootUri": "../foo_package",
"languageVersion": "2.10"
"languageVersion": "2.12"
},
{
"name": "bar",
"rootUri": "../bar1_package",
"languageVersion": "2.10"
"languageVersion": "2.12"
}
]
}

View file

@ -4,12 +4,12 @@
{
"name": "foo",
"rootUri": "../foo_package",
"languageVersion": "2.10"
"languageVersion": "2.12"
},
{
"name": "bar",
"rootUri": "../bar2_package",
"languageVersion": "2.10"
"languageVersion": "2.12"
}
]
}

View file

@ -4,7 +4,7 @@
{
"name": "flu",
"rootUri": "../flu_package",
"languageVersion": "2.10"
"languageVersion": "2.12"
}
]
}

View file

@ -9,7 +9,7 @@
{
"name": "foo",
"rootUri": "../foo",
"languageVersion": "2.10"
"languageVersion": "2.12"
}
]
}

View file

@ -9,7 +9,7 @@
{
"name": "foo",
"rootUri": "../foo",
"languageVersion": "2.10"
"languageVersion": "2.12"
}
]
}

View file

@ -9,7 +9,7 @@
{
"name": "foo",
"rootUri": "../foo",
"languageVersion": "2.10"
"languageVersion": "2.12"
}
]
}

View file

@ -9,7 +9,7 @@
{
"name": "foo",
"rootUri": "../foo",
"languageVersion": "2.10"
"languageVersion": "2.12"
}
]
}

View file

@ -25,7 +25,7 @@
#
CHANNEL be
MAJOR 2
MINOR 11
MINOR 12
PATCH 0
PRERELEASE 0
PRERELEASE_PATCH 0

View file

@ -1902,7 +1902,6 @@
"name": "check dart nnbd sdk for static errors",
"script": "out/ReleaseX64/dart-sdk/bin/dart",
"arguments": [
"--enable-experiment=non-nullable",
"pkg/dev_compiler/tool/check_nnbd_sdk.dart"
]
},
@ -2193,7 +2192,6 @@
"arguments": [
"-ndart2js-hostasserts-linux-ia32-d8-unsound",
"--dart2js-batch",
"--enable-experiment=non-nullable",
"observatory_ui"
]
},
@ -2266,7 +2264,6 @@
"-ndart2js-${system}-${runtime}-unsound",
"--dart2js-batch",
"--reset-browser-configuration",
"--enable-experiment=non-nullable",
"observatory_ui"
]
},
@ -2319,7 +2316,6 @@
"arguments": [
"-ndart2js-minified-linux-d8-unsound",
"--dart2js-batch",
"--enable-experiment=non-nullable",
"observatory_ui"
]
},
@ -2392,7 +2388,6 @@
"-ndart2js-minified-csp-linux-chrome-unsound",
"--dart2js-batch",
"--reset-browser-configuration",
"--enable-experiment=non-nullable",
"observatory_ui"
]
},
@ -2426,7 +2421,6 @@
"name": "check dart nnbd sdk for static errors",
"script": "out/ReleaseX64/dart-sdk/bin/dart",
"arguments": [
"--enable-experiment=non-nullable",
"pkg/dev_compiler/tool/check_nnbd_sdk.dart",
"--target",
"dart2js"
@ -2895,7 +2889,6 @@
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": [
"--fatal-warnings",
"--enable-experiment=non-nullable",
"pkg/compiler"
]
},
@ -3073,7 +3066,6 @@
"name": "analyze runtime/observatory",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": [
"--enable-experiment=non-nullable",
"runtime/observatory"
]
},

View file

@ -93,13 +93,9 @@
# default 'language' "category" with code generated for both CFE and Analyzer,
# while other categories can be tailored more specifically.
current-version: '2.11.0'
current-version: '2.12.0'
features:
non-nullable:
help: "Non Nullable by default"
experimentalReleaseVersion: '2.10.0'
triple-shift:
help: "Triple-shift operator"
@ -120,6 +116,11 @@ features:
# on the command line, and will eventually be removed.
#
non-nullable:
help: "Non Nullable by default"
experimentalReleaseVersion: '2.10.0'
enabledIn: '2.12.0'
extension-methods:
help: "Extension Methods"
enabledIn: '2.6.0'