Version 2.13.0-187.0.dev
Merge commit 'bfaed5e9275297cf6529b3d12ec5db697000be84' into 'dev'
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart
index 1484b55..4496ca6 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart
@@ -71,8 +71,8 @@
C6(int i);
}
-C6 constructor_with_implicit_new(C6 c) {
- if (c.bad == null) return;
+C6? constructor_with_implicit_new(C6 c) {
+ if (c.bad == null) return null;
return C6(
/*analyzer.notPromoted(propertyNotPromoted(target: member:C6.bad, type: int?))*/ c
. /*cfe.notPromoted(propertyNotPromoted(target: member:C6.bad, type: int?))*/ bad);
@@ -83,8 +83,8 @@
C7(int i);
}
-C7 constructor_with_explicit_new(C7 c) {
- if (c.bad == null) return;
+C7? constructor_with_explicit_new(C7 c) {
+ if (c.bad == null) return null;
return new C7(
/*analyzer.notPromoted(propertyNotPromoted(target: member:C7.bad, type: int?))*/ c
. /*cfe.notPromoted(propertyNotPromoted(target: member:C7.bad, type: int?))*/ bad);
@@ -395,9 +395,9 @@
}
compoundAssignmentRhs(C26 c) {
- int i = 0;
+ num n = 0;
if (c.bad == null) return;
- i +=
+ n +=
/*analyzer.notPromoted(propertyNotPromoted(target: member:C26.bad, type: int?))*/ c
. /*cfe.notPromoted(propertyNotPromoted(target: member:C26.bad, type: int?))*/ bad;
}
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/extension_property.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/extension_property.dart
index 1ac0a15..d1eedb3 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/extension_property.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/extension_property.dart
@@ -41,11 +41,15 @@
}
get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) {
+ // Note: no context on this error because the property the user is attempting
+ // to promote is on c1, but the property the user is accessing is on c2.
if (c1.i == null) return;
c2.i.isEven;
}
get_property_via_prefixed_identifier_mismatched_property(C c) {
+ // Note: no context on this error because the property the user is attempting
+ // to promote is C.i, but the property the user is accessing is C.j.
if (c.i == null) return;
c.j.isEven;
}
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/field.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/field.dart
index bc0a5e7..c4c35cf 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/field.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/field.dart
@@ -46,11 +46,15 @@
}
get_field_via_prefixed_identifier_mismatched_target(C c1, C c2) {
+ // Note: no context on this error because the property the user is attempting
+ // to promote is on c1, but the property the user is accessing is on c2.
if (c1.i == null) return;
c2.i.isEven;
}
get_field_via_prefixed_identifier_mismatched_property(C c) {
+ // Note: no context on this error because the property the user is attempting
+ // to promote is C.i, but the property the user is accessing is C.j.
if (c.i == null) return;
c.j.isEven;
}
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/for_in_loop_type_not_iterable_nullability_error.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/for_in_loop_type_not_iterable_nullability_error.dart
index 3b89bde7..5bbde08 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/for_in_loop_type_not_iterable_nullability_error.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/for_in_loop_type_not_iterable_nullability_error.dart
@@ -44,8 +44,7 @@
for (var x
in /*analyzer.notPromoted(propertyNotPromoted(target: member:C1.bad, type: List<int>?))*/ c
. /*cfe.notPromoted(propertyNotPromoted(target: member:C1.bad, type: List<int>?))*/ bad)
- null,
- null
+ null: null
};
}
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/property.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/property.dart
index 90fe382..1ba3291 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/property.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/property.dart
@@ -46,11 +46,15 @@
}
get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) {
+ // Note: no context on this error because the property the user is attempting
+ // to promote is on c1, but the property the user is accessing is on c2.
if (c1.i == null) return;
c2.i.isEven;
}
get_property_via_prefixed_identifier_mismatched_property(C c) {
+ // Note: no context on this error because the property the user is attempting
+ // to promote is C.i, but the property the user is accessing is C.j.
if (c.i == null) return;
c.j.isEven;
}
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index f0f4dcb..a2190f6 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -413,6 +413,7 @@
DartFixKindPriority.DEFAULT, "Create local variable '{0}'");
static const CREATE_METHOD = FixKind('dart.fix.create.method',
DartFixKindPriority.DEFAULT, "Create method '{0}'");
+
// todo (pq): used by LintNames.hash_and_equals; consider removing.
static const CREATE_METHOD_MULTI = FixKind('dart.fix.create.method.multi',
DartFixKindPriority.IN_FILE, 'Create methods in file');
@@ -470,6 +471,7 @@
DartFixKindPriority.DEFAULT, "Make field '{0}' not final");
static const MAKE_FINAL =
FixKind('dart.fix.makeFinal', DartFixKindPriority.DEFAULT, 'Make final');
+
// todo (pq): consider parameterizing: 'Make {fields} final...'
static const MAKE_FINAL_MULTI = FixKind('dart.fix.makeFinal.multi',
DartFixKindPriority.IN_FILE, 'Make final where possible in file');
@@ -495,6 +497,7 @@
DartFixKindPriority.DEFAULT, "Remove the '{0}' annotation");
static const REMOVE_ARGUMENT = FixKind('dart.fix.remove.argument',
DartFixKindPriority.DEFAULT, 'Remove argument');
+
// todo (pq): used by LintNames.avoid_redundant_argument_values; consider a parameterized message
static const REMOVE_ARGUMENT_MULTI = FixKind('dart.fix.remove.argument.multi',
DartFixKindPriority.IN_FILE, 'Remove arguments in file');
@@ -510,6 +513,7 @@
DartFixKindPriority.DEFAULT, 'Remove dead code');
static const REMOVE_DUPLICATE_CASE = FixKind('dart.fix.remove.duplicateCase',
DartFixKindPriority.DEFAULT, 'Remove duplicate case statement');
+
// todo (pq): is this dangerous to bulk apply? Consider removing.
static const REMOVE_DUPLICATE_CASE_MULTI = FixKind(
'dart.fix.remove.duplicateCase.multi',
@@ -569,6 +573,7 @@
'dart.fix.remove.methodDeclaration',
DartFixKindPriority.DEFAULT,
'Remove method declaration');
+
// todo (pq): parameterize to make scope explicit
static const REMOVE_METHOD_DECLARATION_MULTI = FixKind(
'dart.fix.remove.methodDeclaration.multi',
@@ -792,6 +797,7 @@
'dart.fix.replace.withIdentifier',
DartFixKindPriority.DEFAULT,
'Replace with identifier');
+
// todo (pq): parameterize message (used by LintNames.avoid_types_on_closure_parameters)
static const REPLACE_WITH_IDENTIFIER_MULTI = FixKind(
'dart.fix.replace.withIdentifier.multi',
@@ -838,7 +844,7 @@
static const REPLACE_WITH_VAR_MULTI = FixKind(
'dart.fix.replace.withVar.multi',
DartFixKindPriority.IN_FILE,
- "Replace unnecessary type annotations with 'var' in file");
+ "Replace type annotations with 'var' in file");
static const SORT_CHILD_PROPERTY_LAST = FixKind(
'dart.fix.sort.childPropertyLast',
DartFixKindPriority.DEFAULT,
diff --git a/pkg/analyzer/lib/src/dart/analysis/context_locator.dart b/pkg/analyzer/lib/src/dart/analysis/context_locator.dart
index f9d86f5..3044e88 100644
--- a/pkg/analyzer/lib/src/dart/analysis/context_locator.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/context_locator.dart
@@ -101,7 +101,8 @@
ContextRootImpl? root;
for (var existingRoot in roots) {
- if (existingRoot.root == location.rootFolder) {
+ if (existingRoot.root.isOrContains(folder.path) &&
+ _matchRootWithLocation(existingRoot, location)) {
root = existingRoot;
break;
}
@@ -123,11 +124,6 @@
root.excludedGlobs, defaultOptionsFile, defaultPackagesFile);
}
- var rootMap = <Folder, ContextRootImpl>{};
- for (var root in roots) {
- rootMap[root.root] = root;
- }
-
for (File file in includedFiles) {
Folder parent = file.parent2;
@@ -138,16 +134,22 @@
defaultRootFolder: () => _fileSystemRoot(parent),
);
- var rootFolder = location.rootFolder;
- var root = rootMap.putIfAbsent(rootFolder, () {
- return _createContextRoot(
- roots,
- rootFolder: rootFolder,
- workspace: location.workspace,
- optionsFile: location.optionsFile,
- packagesFile: location.packagesFile,
- );
- });
+ ContextRootImpl? root;
+ for (var existingRoot in roots) {
+ if (existingRoot.root.isOrContains(file.path) &&
+ _matchRootWithLocation(existingRoot, location)) {
+ root = existingRoot;
+ break;
+ }
+ }
+
+ root ??= _createContextRoot(
+ roots,
+ rootFolder: location.rootFolder,
+ workspace: location.workspace,
+ optionsFile: location.optionsFile,
+ packagesFile: location.packagesFile,
+ );
if (!root.isAnalyzed(file.path)) {
root.included.add(file);
@@ -542,6 +544,32 @@
}
return second;
}
+
+ /// Return `true` if the configuration of [existingRoot] is the same as
+ /// the requested configuration for the [location].
+ static bool _matchRootWithLocation(
+ ContextRootImpl existingRoot,
+ _RootLocation location,
+ ) {
+ if (existingRoot.optionsFile != location.optionsFile) {
+ return false;
+ }
+
+ if (existingRoot.packagesFile != location.packagesFile) {
+ return false;
+ }
+
+ // BasicWorkspace has no special meaning, so can be ignored.
+ // Other workspaces have semantic meaning, so must match.
+ var workspace = location.workspace;
+ if (workspace is! BasicWorkspace) {
+ if (existingRoot.workspace.root != workspace.root) {
+ return false;
+ }
+ }
+
+ return true;
+ }
}
/// The packages [file] found for the [parent].
diff --git a/pkg/analyzer/test/src/dart/analysis/context_locator_test.dart b/pkg/analyzer/test/src/dart/analysis/context_locator_test.dart
index 1166f42..63b08a5 100644
--- a/pkg/analyzer/test/src/dart/analysis/context_locator_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/context_locator_test.dart
@@ -176,23 +176,6 @@
]);
}
- void test_locateRoots_multiple_dirAndNestedDir() {
- Folder outerRootFolder = newFolder('/test/outer');
- File outerOptionsFile = newAnalysisOptionsYamlFile('/test/outer');
- File outerPackagesFile = newDotPackagesFile('/test/outer');
- Folder innerRootFolder = newFolder('/test/outer/examples/inner');
-
- List<ContextRoot> roots = contextLocator.locateRoots(
- includedPaths: [outerRootFolder.path, innerRootFolder.path]);
- expect(roots, hasLength(1));
-
- ContextRoot outerRoot = findRoot(roots, outerRootFolder);
- expect(outerRoot.includedPaths, unorderedEquals([outerRootFolder.path]));
- expect(outerRoot.excludedPaths, isEmpty);
- expect(outerRoot.optionsFile, outerOptionsFile);
- expect(outerRoot.packagesFile, outerPackagesFile);
- }
-
void test_locateRoots_multiple_dirAndNestedDir_excludedByOptions() {
var rootPath = convertPath('/home/test');
var rootFolder = newFolder(rootPath);
@@ -219,14 +202,53 @@
expect(outerRoot.packagesFile, packagesFile);
}
- void test_locateRoots_multiple_dirAndNestedFile() {
+ void test_locateRoots_multiple_dirAndNestedDir_innerConfigurationFiles() {
+ var outerRootFolder = newFolder('/outer');
+ var innerOptionsFile = newAnalysisOptionsYamlFile('/outer/examples/inner');
+ var innerPackagesFile = newDotPackagesFile('/outer/examples/inner');
+ var innerRootFolder = newFolder('/outer/examples/inner');
+
+ var roots = contextLocator.locateRoots(
+ includedPaths: [outerRootFolder.path, innerRootFolder.path],
+ );
+ expect(roots, hasLength(2));
+
+ var outerRoot = findRoot(roots, outerRootFolder);
+ expect(outerRoot.includedPaths, unorderedEquals([outerRootFolder.path]));
+ expect(outerRoot.excludedPaths, unorderedEquals([innerRootFolder.path]));
+ expect(outerRoot.optionsFile, isNull);
+ expect(outerRoot.packagesFile, isNull);
+
+ var innerRoot = findRoot(roots, innerRootFolder);
+ expect(innerRoot.includedPaths, unorderedEquals([innerRootFolder.path]));
+ expect(innerRoot.excludedPaths, isEmpty);
+ expect(innerRoot.optionsFile, innerOptionsFile);
+ expect(innerRoot.packagesFile, innerPackagesFile);
+ }
+
+ void test_locateRoots_multiple_dirAndNestedDir_noConfigurationFiles() {
+ Folder outerRootFolder = newFolder('/test/outer');
+ Folder innerRootFolder = newFolder('/test/outer/examples/inner');
+
+ List<ContextRoot> roots = contextLocator.locateRoots(
+ includedPaths: [outerRootFolder.path, innerRootFolder.path]);
+ expect(roots, hasLength(1));
+
+ ContextRoot outerRoot = findRoot(roots, outerRootFolder);
+ expect(outerRoot.includedPaths, unorderedEquals([outerRootFolder.path]));
+ expect(outerRoot.excludedPaths, isEmpty);
+ expect(outerRoot.optionsFile, isNull);
+ expect(outerRoot.packagesFile, isNull);
+ }
+
+ void test_locateRoots_multiple_dirAndNestedDir_outerConfigurationFiles() {
Folder outerRootFolder = newFolder('/test/outer');
File outerOptionsFile = newAnalysisOptionsYamlFile('/test/outer');
File outerPackagesFile = newDotPackagesFile('/test/outer');
- File testFile = newFile('/test/outer/examples/inner/test.dart');
+ Folder innerRootFolder = newFolder('/test/outer/examples/inner');
- List<ContextRoot> roots = contextLocator
- .locateRoots(includedPaths: [outerRootFolder.path, testFile.path]);
+ List<ContextRoot> roots = contextLocator.locateRoots(
+ includedPaths: [outerRootFolder.path, innerRootFolder.path]);
expect(roots, hasLength(1));
ContextRoot outerRoot = findRoot(roots, outerRootFolder);
@@ -266,7 +288,39 @@
_assertAnalyzedFiles2(root, [optionsFile, fooFile, barFile]);
}
- void test_locateRoots_multiple_dirAndSiblingDir() {
+ void test_locateRoots_multiple_dirAndNestedFile_noConfigurationFiles() {
+ Folder outerRootFolder = newFolder('/test/outer');
+ File testFile = newFile('/test/outer/examples/inner/test.dart');
+
+ List<ContextRoot> roots = contextLocator
+ .locateRoots(includedPaths: [outerRootFolder.path, testFile.path]);
+ expect(roots, hasLength(1));
+
+ ContextRoot outerRoot = findRoot(roots, outerRootFolder);
+ expect(outerRoot.includedPaths, unorderedEquals([outerRootFolder.path]));
+ expect(outerRoot.excludedPaths, isEmpty);
+ expect(outerRoot.optionsFile, isNull);
+ expect(outerRoot.packagesFile, isNull);
+ }
+
+ void test_locateRoots_multiple_dirAndNestedFile_outerConfigurationFiles() {
+ Folder outerRootFolder = newFolder('/test/outer');
+ File outerOptionsFile = newAnalysisOptionsYamlFile('/test/outer');
+ File outerPackagesFile = newDotPackagesFile('/test/outer');
+ File testFile = newFile('/test/outer/examples/inner/test.dart');
+
+ List<ContextRoot> roots = contextLocator
+ .locateRoots(includedPaths: [outerRootFolder.path, testFile.path]);
+ expect(roots, hasLength(1));
+
+ ContextRoot outerRoot = findRoot(roots, outerRootFolder);
+ expect(outerRoot.includedPaths, unorderedEquals([outerRootFolder.path]));
+ expect(outerRoot.excludedPaths, isEmpty);
+ expect(outerRoot.optionsFile, outerOptionsFile);
+ expect(outerRoot.packagesFile, outerPackagesFile);
+ }
+
+ void test_locateRoots_multiple_dirAndSiblingDir_bothConfigurationFiles() {
Folder outer1RootFolder = newFolder('/test/outer1');
File outer1OptionsFile = newAnalysisOptionsYamlFile('/test/outer1');
File outer1PackagesFile = newDotPackagesFile('/test/outer1');
@@ -292,6 +346,27 @@
expect(outer2Root.packagesFile, outer2PackagesFile);
}
+ void test_locateRoots_multiple_dirAndSiblingDir_noConfigurationFiles() {
+ Folder outer1RootFolder = newFolder('/test/outer1');
+ Folder outer2RootFolder = newFolder('/test/outer2');
+
+ List<ContextRoot> roots = contextLocator.locateRoots(
+ includedPaths: [outer1RootFolder.path, outer2RootFolder.path]);
+ expect(roots, hasLength(2));
+
+ ContextRoot outer1Root = findRoot(roots, outer1RootFolder);
+ expect(outer1Root.includedPaths, unorderedEquals([outer1RootFolder.path]));
+ expect(outer1Root.excludedPaths, isEmpty);
+ expect(outer1Root.optionsFile, isNull);
+ expect(outer1Root.packagesFile, isNull);
+
+ ContextRoot outer2Root = findRoot(roots, outer2RootFolder);
+ expect(outer2Root.includedPaths, unorderedEquals([outer2RootFolder.path]));
+ expect(outer2Root.excludedPaths, isEmpty);
+ expect(outer2Root.optionsFile, isNull);
+ expect(outer2Root.packagesFile, isNull);
+ }
+
void test_locateRoots_multiple_dirAndSiblingFile() {
Folder outer1RootFolder = newFolder('/test/outer1');
File outer1OptionsFile = newAnalysisOptionsYamlFile('/test/outer1');
@@ -318,6 +393,65 @@
expect(outer2Root.packagesFile, outer2PackagesFile);
}
+ void test_locateRoots_multiple_dirAndSiblingFile_noConfigurationFiles() {
+ Folder outer1RootFolder = newFolder('/test/outer1');
+ File testFile = newFile('/test/outer2/test.dart');
+
+ List<ContextRoot> roots = contextLocator
+ .locateRoots(includedPaths: [outer1RootFolder.path, testFile.path]);
+ expect(roots, hasLength(2));
+
+ ContextRoot outer1Root = findRoot(roots, outer1RootFolder);
+ expect(outer1Root.includedPaths, unorderedEquals([outer1RootFolder.path]));
+ expect(outer1Root.excludedPaths, isEmpty);
+ expect(outer1Root.optionsFile, isNull);
+ expect(outer1Root.packagesFile, isNull);
+
+ ContextRoot outer2Root = findRoot(roots, getFolder('/'));
+ expect(outer2Root.includedPaths, unorderedEquals([testFile.path]));
+ expect(outer2Root.excludedPaths, isEmpty);
+ expect(outer2Root.optionsFile, isNull);
+ expect(outer2Root.packagesFile, isNull);
+ }
+
+ void test_locateRoots_multiple_dirs_bazel_differentWorkspaces() {
+ var workspacePath1 = '/home/workspace1';
+ var workspacePath2 = '/home/workspace2';
+ var pkgPath1 = '$workspacePath1/pkg1';
+ var pkgPath2 = '$workspacePath2/pkg2';
+
+ newFile('$workspacePath1/WORKSPACE');
+ newFile('$workspacePath2/WORKSPACE');
+ newBazelBuildFile(pkgPath1, '');
+ newBazelBuildFile(pkgPath2, '');
+
+ var folder1 = newFolder('$pkgPath1/lib/folder1');
+ var folder2 = newFolder('$pkgPath2/lib/folder2');
+ var file1 = newFile('$pkgPath1/lib/folder1/file1.dart');
+ var file2 = newFile('$pkgPath2/lib/folder2/file2.dart');
+
+ var roots = contextLocator.locateRoots(
+ includedPaths: [folder1.path, folder2.path],
+ );
+ expect(roots, hasLength(2));
+
+ var root1 = findRoot(roots, getFolder(folder1.path));
+ expect(root1.includedPaths, unorderedEquals([folder1.path]));
+ expect(root1.excludedPaths, isEmpty);
+ expect(root1.optionsFile, isNull);
+ expect(root1.packagesFile, isNull);
+ _assertBazelWorkspace(root1.workspace, workspacePath1);
+ _assertAnalyzedFiles2(root1, [file1]);
+
+ var root2 = findRoot(roots, getFolder(folder2.path));
+ expect(root2.includedPaths, unorderedEquals([folder2.path]));
+ expect(root2.excludedPaths, isEmpty);
+ expect(root2.optionsFile, isNull);
+ expect(root2.packagesFile, isNull);
+ _assertBazelWorkspace(root2.workspace, workspacePath2);
+ _assertAnalyzedFiles2(root2, [file2]);
+ }
+
/// Even if a file is excluded by the options, when it is explicitly included
/// into analysis, it should be analyzed.
void test_locateRoots_multiple_fileAndSiblingFile_excludedByOptions() {
diff --git a/pkg/compiler/lib/src/commandline_options.dart b/pkg/compiler/lib/src/commandline_options.dart
index e0c45c8..45b02a0 100644
--- a/pkg/compiler/lib/src/commandline_options.dart
+++ b/pkg/compiler/lib/src/commandline_options.dart
@@ -106,6 +106,7 @@
static const String dillDependencies = '--dill-dependencies';
static const String readData = '--read-data';
static const String writeData = '--write-data';
+ static const String noClosedWorldInData = '--no-closed-world-in-data';
static const String writeClosedWorld = '--write-closed-world';
static const String readClosedWorld = '--read-closed-world';
static const String readCodegen = '--read-codegen';
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 571e8ce..8f52c10 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -236,6 +236,10 @@
options.readCodegenUri == null;
}
+ bool get onlyPerformCodegen {
+ return options.readClosedWorldUri != null && options.readDataUri != null;
+ }
+
Future runInternal(Uri uri) async {
clearState();
assert(uri != null);
@@ -250,30 +254,32 @@
GlobalTypeInferenceResults globalTypeInferenceResults =
performGlobalTypeInference(closedWorld);
if (options.writeDataUri != null) {
- serializationTask
- .serializeGlobalTypeInference(globalTypeInferenceResults);
+ if (options.noClosedWorldInData) {
+ serializationTask
+ .serializeGlobalTypeInference(globalTypeInferenceResults);
+ } else {
+ serializationTask
+ .serializeGlobalTypeInferenceLegacy(globalTypeInferenceResults);
+ }
return;
}
await generateJavaScriptCode(globalTypeInferenceResults);
- } else if (options.readDataUri != null) {
+ } else if (onlyPerformCodegen) {
GlobalTypeInferenceResults globalTypeInferenceResults;
- if (options.readClosedWorldUri != null) {
- ir.Component component =
- await serializationTask.deserializeComponentAndUpdateOptions();
- JsClosedWorld closedWorld =
- await serializationTask.deserializeClosedWorld(
- environment, abstractValueStrategy, component);
- globalTypeInferenceResults =
- await serializationTask.deserializeGlobalAnalysis(
- environment, abstractValueStrategy, component, closedWorld);
- } else {
- globalTypeInferenceResults = await serializationTask
- .deserializeGlobalTypeInference(environment, abstractValueStrategy);
- }
- if (options.debugGlobalInference) {
- performGlobalTypeInference(globalTypeInferenceResults.closedWorld);
- return;
- }
+ ir.Component component =
+ await serializationTask.deserializeComponentAndUpdateOptions();
+ JsClosedWorld closedWorld =
+ await serializationTask.deserializeClosedWorld(
+ environment, abstractValueStrategy, component);
+ globalTypeInferenceResults =
+ await serializationTask.deserializeGlobalTypeInferenceResults(
+ environment, abstractValueStrategy, component, closedWorld);
+ await generateJavaScriptCode(globalTypeInferenceResults);
+ } else if (options.readDataUri != null) {
+ // TODO(joshualitt) delete and clean up after google3 roll
+ var globalTypeInferenceResults =
+ await serializationTask.deserializeGlobalTypeInferenceLegacy(
+ environment, abstractValueStrategy);
await generateJavaScriptCode(globalTypeInferenceResults);
} else {
KernelResult result = await kernelLoader.load(uri);
@@ -444,14 +450,18 @@
GlobalTypeInferenceResults results) {
SerializationStrategy strategy = const BytesInMemorySerializationStrategy();
List<int> irData = strategy.unpackAndSerializeComponent(results);
- List worldData = strategy.serializeGlobalTypeInferenceResults(results);
+ List<int> closedWorldData =
+ strategy.serializeClosedWorld(results.closedWorld);
+ List<int> globalTypeInferenceResultsData =
+ strategy.serializeGlobalTypeInferenceResults(results);
return strategy.deserializeGlobalTypeInferenceResults(
options,
reporter,
environment,
abstractValueStrategy,
strategy.deserializeComponent(irData),
- worldData);
+ closedWorldData,
+ globalTypeInferenceResultsData);
}
void compileFromKernel(Uri rootLibraryUri, Iterable<Uri> libraries) {
@@ -475,7 +485,14 @@
GlobalTypeInferenceResults globalInferenceResults =
performGlobalTypeInference(closedWorld);
if (options.writeDataUri != null) {
- serializationTask.serializeGlobalTypeInference(globalInferenceResults);
+ // TODO(joshualitt) delete after google3 roll.
+ if (options.noClosedWorldInData) {
+ serializationTask
+ .serializeGlobalTypeInference(globalInferenceResults);
+ } else {
+ serializationTask
+ .serializeGlobalTypeInferenceLegacy(globalInferenceResults);
+ }
return;
}
if (options.testMode) {
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index d4a9558..b96bd5d 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -277,8 +277,15 @@
if (argument != Flags.readData) {
readDataUri = fe.nativeToUri(extractPath(argument, isDirectory: false));
}
- if (readStrategy != ReadStrategy.fromCodegen) {
+
+ if (readStrategy == ReadStrategy.fromDart) {
readStrategy = ReadStrategy.fromData;
+ } else if (readStrategy == ReadStrategy.fromClosedWorld) {
+ readStrategy = ReadStrategy.fromDataAndClosedWorld;
+ } else if (readStrategy == ReadStrategy.fromCodegen) {
+ readStrategy = ReadStrategy.fromCodegenAndData;
+ } else if (readStrategy == ReadStrategy.fromCodegenAndClosedWorld) {
+ readStrategy = ReadStrategy.fromCodegenAndClosedWorldAndData;
}
}
@@ -287,7 +294,16 @@
readClosedWorldUri =
fe.nativeToUri(extractPath(argument, isDirectory: false));
}
- readStrategy = ReadStrategy.fromClosedWorld;
+
+ if (readStrategy == ReadStrategy.fromDart) {
+ readStrategy = ReadStrategy.fromClosedWorld;
+ } else if (readStrategy == ReadStrategy.fromData) {
+ readStrategy = ReadStrategy.fromDataAndClosedWorld;
+ } else if (readStrategy == ReadStrategy.fromCodegen) {
+ readStrategy = ReadStrategy.fromCodegenAndClosedWorld;
+ } else if (readStrategy == ReadStrategy.fromCodegenAndData) {
+ readStrategy = ReadStrategy.fromCodegenAndClosedWorldAndData;
+ }
}
void setDillDependencies(String argument) {
@@ -318,7 +334,16 @@
readCodegenUri =
fe.nativeToUri(extractPath(argument, isDirectory: false));
}
- readStrategy = ReadStrategy.fromCodegen;
+
+ if (readStrategy == ReadStrategy.fromDart) {
+ readStrategy = ReadStrategy.fromCodegen;
+ } else if (readStrategy == ReadStrategy.fromClosedWorld) {
+ readStrategy = ReadStrategy.fromCodegenAndClosedWorld;
+ } else if (readStrategy == ReadStrategy.fromData) {
+ readStrategy = ReadStrategy.fromCodegenAndData;
+ } else if (readStrategy == ReadStrategy.fromDataAndClosedWorld) {
+ readStrategy = ReadStrategy.fromCodegenAndClosedWorldAndData;
+ }
}
void setWriteData(String argument) {
@@ -466,6 +491,7 @@
new OptionHandler('${Flags.dillDependencies}=.+', setDillDependencies),
new OptionHandler('${Flags.readData}|${Flags.readData}=.+', setReadData),
new OptionHandler('${Flags.writeData}|${Flags.writeData}=.+', setWriteData),
+ new OptionHandler(Flags.noClosedWorldInData, passThrough),
new OptionHandler('${Flags.readClosedWorld}|${Flags.readClosedWorld}=.+',
setReadClosedWorld),
new OptionHandler('${Flags.writeClosedWorld}|${Flags.writeClosedWorld}=.+',
@@ -709,7 +735,9 @@
if (readStrategy == ReadStrategy.fromCodegen) {
fail("Cannot read and write serialized codegen simultaneously.");
}
- if (readStrategy != ReadStrategy.fromData) {
+ // TODO(joshualitt) cleanup after google3 roll.
+ if (readStrategy != ReadStrategy.fromData &&
+ readStrategy != ReadStrategy.fromDataAndClosedWorld) {
fail("Can only write serialized codegen from serialized data.");
}
if (codegenShards == null) {
@@ -737,6 +765,8 @@
options.add('${Flags.readClosedWorld}=${readClosedWorldUri}');
break;
case ReadStrategy.fromData:
+ // TODO(joshualitt): fail after Google3 roll.
+ // fail("Must read from closed world and data.");
readDataUri ??= Uri.base.resolve('$scriptName.data');
options.add('${Flags.readData}=${readDataUri}');
break;
@@ -747,6 +777,8 @@
options.add('${Flags.readData}=${readDataUri}');
break;
case ReadStrategy.fromCodegen:
+ case ReadStrategy.fromCodegenAndData:
+ // TODO(joshualitt): fall through to fail after google3 roll.
readDataUri ??= Uri.base.resolve('$scriptName.data');
options.add('${Flags.readData}=${readDataUri}');
readCodegenUri ??= Uri.base.resolve('$scriptName.code');
@@ -760,6 +792,9 @@
options.add('${Flags.codegenShards}=$codegenShards');
break;
case ReadStrategy.fromCodegenAndClosedWorld:
+ fail("Must read from closed world, data, and codegen");
+ break;
+ case ReadStrategy.fromCodegenAndClosedWorldAndData:
readClosedWorldUri ??= Uri.base.resolve('$scriptName.world');
options.add('${Flags.readClosedWorld}=${readClosedWorldUri}');
readDataUri ??= Uri.base.resolve('$scriptName.data');
@@ -816,6 +851,8 @@
summary = 'Data files $input and $dataInput ';
break;
case ReadStrategy.fromData:
+ // TODO(joshualitt): fail after google3 roll.
+ //fail("Must read from closed world and data.");
inputName = 'bytes data';
inputSize = inputProvider.dartCharactersRead;
String dataInput =
@@ -832,6 +869,8 @@
summary = 'Data files $input, $worldInput, and $dataInput ';
break;
case ReadStrategy.fromCodegen:
+ case ReadStrategy.fromCodegenAndData:
+ // TODO(joshualitt): Fall through to fail after google3 roll.
inputName = 'bytes data';
inputSize = inputProvider.dartCharactersRead;
String dataInput =
@@ -842,6 +881,9 @@
'${codeInput}[0-${codegenShards - 1}] ';
break;
case ReadStrategy.fromCodegenAndClosedWorld:
+ fail("Must read from closed world, data, and codegen");
+ break;
+ case ReadStrategy.fromCodegenAndClosedWorldAndData:
inputName = 'bytes data';
inputSize = inputProvider.dartCharactersRead;
String worldInput =
@@ -1373,12 +1415,17 @@
});
}
+// TODO(joshualitt): Clean up the combinatorial explosion of read strategies.
+// Right now only fromClosedWorld, fromDataAndClosedWorld, and
+// fromCodegenAndClosedWorldAndData are valid.
enum ReadStrategy {
fromDart,
fromClosedWorld,
fromData,
fromDataAndClosedWorld,
fromCodegen,
- fromCodegenAndClosedWorld
+ fromCodegenAndClosedWorld,
+ fromCodegenAndData,
+ fromCodegenAndClosedWorldAndData,
}
enum WriteStrategy { toKernel, toClosedWorld, toData, toCodegen, toJs }
diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
index dd195cf..1ab1d09 100644
--- a/pkg/compiler/lib/src/js_emitter/model.dart
+++ b/pkg/compiler/lib/src/js_emitter/model.dart
@@ -261,6 +261,9 @@
/// Uses indicate missing information in the model.
final ClassEntity element;
+ // TODO(joshualitt): Now that we collect all rti needed classes and handle
+ // them separately, we should investigate whether or not we still need to
+ // store the type data on the class.
final ClassTypeData typeData;
final js.Name name;
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart b/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
index bac69a0..f4afd75 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
@@ -24,7 +24,6 @@
final Set<ClassEntity> neededClasses = {};
final Set<ClassEntity> neededClassTypes = {};
- final Set<ClassEntity> classesOnlyNeededForRti = {};
final Set<ClassEntity> classesOnlyNeededForConstructor = {};
final Map<OutputUnit, List<ClassEntity>> outputClassLists = {};
final Map<OutputUnit, List<ClassEntity>> outputClassTypeLists = {};
@@ -140,17 +139,6 @@
Set<ClassEntity> backendTypeHelpers =
getBackendTypeHelpers(_commonElements).toSet();
- /// A class type is 'shadowed' if the class is needed for direct
- /// instantiation in one OutputUnit while its type is needed in another
- /// OutputUnit.
- bool isClassTypeShadowed(ClassEntity cls) {
- return !backendTypeHelpers.contains(cls) &&
- _rtiNeededClasses.contains(cls) &&
- !classesOnlyNeededForRti.contains(cls) &&
- _outputUnitData.outputUnitForClass(cls) !=
- _outputUnitData.outputUnitForClassType(cls);
- }
-
// Compute needed classes.
Set<ClassEntity> instantiatedClasses =
// TODO(johnniwinther): This should be accessed from a codegen closed
@@ -184,20 +172,10 @@
}
}
- // 4. Find all classes needed for rti.
- // It is important that this is the penultimate step, at this point,
- // neededClasses must only contain classes that have been resolved and
- // codegen'd. The rtiNeededClasses may contain additional classes, but
- // these are thought to not have been instantiated, so we need to be able
- // to identify them later and make sure we only emit "empty shells" without
- // fields, etc.
+ // 4. Find all class types needed for rti.
for (ClassEntity cls in _rtiNeededClasses) {
if (backendTypeHelpers.contains(cls)) continue;
- while (cls != null && !neededClasses.contains(cls)) {
- if (!classesOnlyNeededForRti.add(cls)) break;
- // TODO(joshualitt) delete classesOnlyNeededForRti when the
- // no-defer-class_types flag is removed.
- neededClassTypes.add(cls);
+ while (cls != null && neededClassTypes.add(cls)) {
cls = _elementEnvironment.getSuperClass(cls);
}
}
@@ -219,14 +197,7 @@
}
}
- // 6. Collect any class types 'shadowed' by direct instantiation.
- for (ClassEntity cls in _rtiNeededClasses) {
- if (isClassTypeShadowed(cls)) {
- neededClassTypes.add(cls);
- }
- }
-
- // 7. Sort classes needed for type checking and then add them to their
+ // 6. Sort classes needed for type checking and then add them to their
// respective OutputUnits.
for (ClassEntity cls in _sorter.sortClasses(neededClassTypes)) {
outputClassTypeLists
diff --git a/pkg/compiler/lib/src/options.dart b/pkg/compiler/lib/src/options.dart
index 03edd91..ce9cddb 100644
--- a/pkg/compiler/lib/src/options.dart
+++ b/pkg/compiler/lib/src/options.dart
@@ -77,6 +77,11 @@
/// If this is set, the compilation stops after type inference.
Uri writeDataUri;
+ /// Serialize data without the closed world.
+ /// TODO(joshualitt) make this the default right after landing in Google3 and
+ /// clean up.
+ bool noClosedWorldInData = false;
+
/// Location from which the serialized closed world is read.
///
/// If this is set, the [entryPoint] is expected to be a .dill file and the
@@ -542,6 +547,7 @@
_extractUriListOption(options, '${Flags.dillDependencies}')
..readDataUri = _extractUriOption(options, '${Flags.readData}=')
..writeDataUri = _extractUriOption(options, '${Flags.writeData}=')
+ ..noClosedWorldInData = _hasOption(options, Flags.noClosedWorldInData)
..readClosedWorldUri =
_extractUriOption(options, '${Flags.readClosedWorld}=')
..writeClosedWorldUri =
diff --git a/pkg/compiler/lib/src/serialization/strategies.dart b/pkg/compiler/lib/src/serialization/strategies.dart
index 37fbe89..9269eed 100644
--- a/pkg/compiler/lib/src/serialization/strategies.dart
+++ b/pkg/compiler/lib/src/serialization/strategies.dart
@@ -49,7 +49,8 @@
Environment environment,
AbstractValueStrategy abstractValueStrategy,
ir.Component component,
- List<T> data);
+ List<T> closedWorldData,
+ List<T> globalTypeInferenceResultsData);
List<T> serializeClosedWorld(JsClosedWorld closedWorld);
@@ -83,10 +84,28 @@
Environment environment,
AbstractValueStrategy abstractValueStrategy,
ir.Component component,
- List<int> data) {
- DataSource source = new BinarySourceImpl(data, useDataKinds: useDataKinds);
- return deserializeGlobalTypeInferenceResultsFromSource(options, reporter,
- environment, abstractValueStrategy, component, source);
+ List<int> closedWorldData,
+ List<int> globalTypeInferenceResultsData) {
+ DataSource closedWorldSource =
+ BinarySourceImpl(closedWorldData, useDataKinds: useDataKinds);
+ DataSource globalTypeInferenceResultsSource = BinarySourceImpl(
+ globalTypeInferenceResultsData,
+ useDataKinds: useDataKinds);
+ JsClosedWorld closedWorld = deserializeClosedWorldFromSource(
+ options,
+ reporter,
+ environment,
+ abstractValueStrategy,
+ component,
+ closedWorldSource);
+ return deserializeGlobalTypeInferenceResultsFromSource(
+ options,
+ reporter,
+ environment,
+ abstractValueStrategy,
+ component,
+ closedWorld,
+ globalTypeInferenceResultsSource);
}
@override
@@ -134,10 +153,28 @@
Environment environment,
AbstractValueStrategy abstractValueStrategy,
ir.Component component,
- List<int> data) {
- DataSource source = new BinarySourceImpl(data, useDataKinds: useDataKinds);
- return deserializeGlobalTypeInferenceResultsFromSource(options, reporter,
- environment, abstractValueStrategy, component, source);
+ List<int> closedWorldData,
+ List<int> globalTypeInferenceResultsData) {
+ DataSource closedWorldSource =
+ BinarySourceImpl(closedWorldData, useDataKinds: useDataKinds);
+ DataSource globalTypeInferenceResultsSource = BinarySourceImpl(
+ globalTypeInferenceResultsData,
+ useDataKinds: useDataKinds);
+ JsClosedWorld closedWorld = deserializeClosedWorldFromSource(
+ options,
+ reporter,
+ environment,
+ abstractValueStrategy,
+ component,
+ closedWorldSource);
+ return deserializeGlobalTypeInferenceResultsFromSource(
+ options,
+ reporter,
+ environment,
+ abstractValueStrategy,
+ component,
+ closedWorld,
+ globalTypeInferenceResultsSource);
}
@override
@@ -186,10 +223,28 @@
Environment environment,
AbstractValueStrategy abstractValueStrategy,
ir.Component component,
- List<Object> data) {
- DataSource source = new ObjectSource(data, useDataKinds: useDataKinds);
- return deserializeGlobalTypeInferenceResultsFromSource(options, reporter,
- environment, abstractValueStrategy, component, source);
+ List<Object> closedWorldData,
+ List<Object> globalTypeInferenceResultsData) {
+ DataSource closedWorldSource =
+ ObjectSource(closedWorldData, useDataKinds: useDataKinds);
+ DataSource globalTypeInferenceResultsSource = ObjectSource(
+ globalTypeInferenceResultsData,
+ useDataKinds: useDataKinds);
+ JsClosedWorld closedWorld = deserializeClosedWorldFromSource(
+ options,
+ reporter,
+ environment,
+ abstractValueStrategy,
+ component,
+ closedWorldSource);
+ return deserializeGlobalTypeInferenceResultsFromSource(
+ options,
+ reporter,
+ environment,
+ abstractValueStrategy,
+ component,
+ closedWorld,
+ globalTypeInferenceResultsSource);
}
@override
diff --git a/pkg/compiler/lib/src/serialization/task.dart b/pkg/compiler/lib/src/serialization/task.dart
index 6e5c4c8..cfc2b0d 100644
--- a/pkg/compiler/lib/src/serialization/task.dart
+++ b/pkg/compiler/lib/src/serialization/task.dart
@@ -19,6 +19,7 @@
import '../js_backend/backend.dart';
import '../js_backend/inferred_data.dart';
import '../js_model/js_world.dart';
+import '../js_model/element_map_impl.dart';
import '../js_model/locals.dart';
import '../options.dart';
import '../util/sink_adapter.dart';
@@ -30,40 +31,50 @@
JsClosedWorld closedWorld = results.closedWorld;
GlobalLocalsMap globalLocalsMap = results.globalLocalsMap;
InferredData inferredData = results.inferredData;
- closedWorld.writeToDataSink(sink);
globalLocalsMap.writeToDataSink(sink);
inferredData.writeToDataSink(sink);
results.writeToDataSink(sink, closedWorld.elementMap);
sink.close();
}
-GlobalTypeInferenceResults deserializeGlobalAnalysisFromSource(
- CompilerOptions options,
- DiagnosticReporter reporter,
- Environment environment,
- AbstractValueStrategy abstractValueStrategy,
- ir.Component component,
- JsClosedWorld newClosedWorld,
- DataSource source) {
- GlobalLocalsMap newGlobalLocalsMap = GlobalLocalsMap.readFromDataSource(
- newClosedWorld.closureDataLookup.getEnclosingMember, source);
- InferredData newInferredData =
- InferredData.readFromDataSource(source, newClosedWorld);
- return GlobalTypeInferenceResults.readFromDataSource(
- source,
- newClosedWorld.elementMap,
- newClosedWorld,
- newGlobalLocalsMap,
- newInferredData);
-}
-
GlobalTypeInferenceResults deserializeGlobalTypeInferenceResultsFromSource(
CompilerOptions options,
DiagnosticReporter reporter,
Environment environment,
AbstractValueStrategy abstractValueStrategy,
ir.Component component,
+ JsClosedWorld closedWorld,
DataSource source) {
+ source.registerComponentLookup(ComponentLookup(component));
+ source.registerEntityLookup(ClosedEntityLookup(closedWorld.elementMap));
+ GlobalLocalsMap globalLocalsMap = GlobalLocalsMap.readFromDataSource(
+ closedWorld.closureDataLookup.getEnclosingMember, source);
+ InferredData inferredData =
+ InferredData.readFromDataSource(source, closedWorld);
+ return GlobalTypeInferenceResults.readFromDataSource(source,
+ closedWorld.elementMap, closedWorld, globalLocalsMap, inferredData);
+}
+
+void serializeGlobalTypeInferenceResultsToSinkLegacy(
+ GlobalTypeInferenceResults results, DataSink sink) {
+ JsClosedWorld closedWorld = results.closedWorld;
+ GlobalLocalsMap globalLocalsMap = results.globalLocalsMap;
+ InferredData inferredData = results.inferredData;
+ closedWorld.writeToDataSink(sink);
+ globalLocalsMap.writeToDataSink(sink);
+ inferredData.writeToDataSink(sink);
+ results.writeToDataSink(sink, closedWorld.elementMap);
+ sink.close();
+}
+
+GlobalTypeInferenceResults
+ deserializeGlobalTypeInferenceResultsFromSourceLegacy(
+ CompilerOptions options,
+ DiagnosticReporter reporter,
+ Environment environment,
+ AbstractValueStrategy abstractValueStrategy,
+ ir.Component component,
+ DataSource source) {
JsClosedWorld newClosedWorld = new JsClosedWorld.readFromDataSource(
options, reporter, environment, abstractValueStrategy, component, source);
GlobalLocalsMap newGlobalLocalsMap = GlobalLocalsMap.readFromDataSource(
@@ -213,23 +224,7 @@
});
}
- Future<GlobalTypeInferenceResults> deserializeGlobalTypeInference(
- Environment environment,
- AbstractValueStrategy abstractValueStrategy) async {
- ir.Component component = await deserializeComponentAndUpdateOptions();
-
- return await measureIoSubtask('deserialize data', () async {
- _reporter.log('Reading data from ${_options.readDataUri}');
- api.Input<List<int>> dataInput = await _provider
- .readFromUri(_options.readDataUri, inputKind: api.InputKind.binary);
- DataSource source =
- BinarySourceImpl(dataInput.data, stringInterner: _stringInterner);
- return deserializeGlobalTypeInferenceResultsFromSource(_options,
- _reporter, environment, abstractValueStrategy, component, source);
- });
- }
-
- Future<GlobalTypeInferenceResults> deserializeGlobalAnalysis(
+ Future<GlobalTypeInferenceResults> deserializeGlobalTypeInferenceResults(
Environment environment,
AbstractValueStrategy abstractValueStrategy,
ir.Component component,
@@ -240,8 +235,45 @@
.readFromUri(_options.readDataUri, inputKind: api.InputKind.binary);
DataSource source =
BinarySourceImpl(dataInput.data, stringInterner: _stringInterner);
- return deserializeGlobalAnalysisFromSource(_options, _reporter,
- environment, abstractValueStrategy, component, closedWorld, source);
+ return deserializeGlobalTypeInferenceResultsFromSource(
+ _options,
+ _reporter,
+ environment,
+ abstractValueStrategy,
+ component,
+ closedWorld,
+ source);
+ });
+ }
+
+ // TODO(joshualitt) get rid of legacy functions after Google3 roll.
+ void serializeGlobalTypeInferenceLegacy(GlobalTypeInferenceResults results) {
+ JsClosedWorld closedWorld = results.closedWorld;
+ ir.Component component = closedWorld.elementMap.programEnv.mainComponent;
+ serializeComponent(component);
+
+ measureSubtask('serialize data', () {
+ _reporter.log('Writing data to ${_options.writeDataUri}');
+ api.BinaryOutputSink dataOutput =
+ _outputProvider.createBinarySink(_options.writeDataUri);
+ DataSink sink = new BinarySink(new BinaryOutputSinkAdapter(dataOutput));
+ serializeGlobalTypeInferenceResultsToSinkLegacy(results, sink);
+ });
+ }
+
+ Future<GlobalTypeInferenceResults> deserializeGlobalTypeInferenceLegacy(
+ Environment environment,
+ AbstractValueStrategy abstractValueStrategy) async {
+ ir.Component component = await deserializeComponentAndUpdateOptions();
+
+ return await measureIoSubtask('deserialize data', () async {
+ _reporter.log('Reading data from ${_options.readDataUri}');
+ api.Input<List<int>> dataInput = await _provider
+ .readFromUri(_options.readDataUri, inputKind: api.InputKind.binary);
+ DataSource source =
+ BinarySourceImpl(dataInput.data, stringInterner: _stringInterner);
+ return deserializeGlobalTypeInferenceResultsFromSourceLegacy(_options,
+ _reporter, environment, abstractValueStrategy, component, source);
});
}
diff --git a/pkg/compiler/test/codegen/data/shift_right_unsigned.dart b/pkg/compiler/test/codegen/data/shift_right_unsigned.dart
index 755d743..23043cf 100644
--- a/pkg/compiler/test/codegen/data/shift_right_unsigned.dart
+++ b/pkg/compiler/test/codegen/data/shift_right_unsigned.dart
@@ -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.12
+//@dart=2.13
/*member: main:ignore*/
void main() {
diff --git a/pkg/compiler/test/codegen/shift_right_unsigned_test.dart b/pkg/compiler/test/codegen/shift_right_unsigned_test.dart
index 786bc71..d4d6d2c 100644
--- a/pkg/compiler/test/codegen/shift_right_unsigned_test.dart
+++ b/pkg/compiler/test/codegen/shift_right_unsigned_test.dart
@@ -133,6 +133,7 @@
methodName: 'foo',
disableTypeInference: false,
enableTripleShift: true,
+ soundNullSafety: true,
check: checkerForAbsentPresent(test));
}
diff --git a/pkg/compiler/test/deferred_loading/data/shadowed_types/lib_shared.dart b/pkg/compiler/test/deferred_loading/data/shadowed_types/lib_shared.dart
new file mode 100644
index 0000000..5b20db1
--- /dev/null
+++ b/pkg/compiler/test/deferred_loading/data/shadowed_types/lib_shared.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/*class: A:
+ class_unit=1{libb},
+ type_unit=2{libb, liba}
+*/
+/*member: A.:member_unit=1{libb}*/
+class A {}
+
+/*class: B:
+ class_unit=main{},
+ type_unit=main{}
+*/
+/*member: B.:member_unit=main{}*/
+class B {}
+
+/*class: C_Parent:
+ class_unit=1{libb},
+ type_unit=main{}
+*/
+/*member: C_Parent.:member_unit=1{libb}*/
+class C_Parent {}
+
+/*class: D:
+ class_unit=1{libb},
+ type_unit=2{libb, liba}
+*/
+/*member: D.:member_unit=1{libb}*/
+class D {}
+
+/*class: E:
+ class_unit=1{libb},
+ type_unit=1{libb}
+*/
+/*member: E.:member_unit=1{libb}*/
+class E extends D {}
+
+/*class: F:
+ class_unit=1{libb},
+ type_unit=1{libb}
+*/
+/*member: F.:member_unit=1{libb}*/
+class F {}
diff --git a/pkg/compiler/test/deferred_loading/data/shadowed_types/liba.dart b/pkg/compiler/test/deferred_loading/data/shadowed_types/liba.dart
new file mode 100644
index 0000000..4ea6fd2
--- /dev/null
+++ b/pkg/compiler/test/deferred_loading/data/shadowed_types/liba.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+import 'lib_shared.dart';
+
+@pragma('dart2js:noInline')
+/*member: isA:member_unit=3{liba}*/
+isA(foo) {
+ return foo is A;
+}
+
+@pragma('dart2js:noInline')
+/*member: isD:member_unit=3{liba}*/
+isD(foo) {
+ return foo is D;
+}
diff --git a/pkg/compiler/test/deferred_loading/data/shadowed_types/libb.dart b/pkg/compiler/test/deferred_loading/data/shadowed_types/libb.dart
new file mode 100644
index 0000000..a5a125c
--- /dev/null
+++ b/pkg/compiler/test/deferred_loading/data/shadowed_types/libb.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+import 'lib_shared.dart';
+
+@pragma('dart2js:noInline')
+/*member: createA:member_unit=1{libb}*/
+createA() {
+ return A();
+}
+
+@pragma('dart2js:noInline')
+/*member: isB:member_unit=1{libb}*/
+isB(foo) {
+ return foo is B;
+}
+
+/*class: C:
+ class_unit=1{libb},
+ type_unit=main{}
+*/
+/*member: C.:member_unit=1{libb}*/
+class C extends C_Parent {}
+
+@pragma('dart2js:noInline')
+/*member: createC:member_unit=1{libb}*/
+createC() {
+ return C();
+}
+
+@pragma('dart2js:noInline')
+/*member: createE:member_unit=1{libb}*/
+createE() {
+ return E();
+}
+
+@pragma('dart2js:noInline')
+/*member: isFWithUnused:member_unit=1{libb}*/
+isFWithUnused(foo) {
+ var unused = F();
+ return foo is F;
+}
diff --git a/pkg/compiler/test/deferred_loading/data/shadowed_types/main.dart b/pkg/compiler/test/deferred_loading/data/shadowed_types/main.dart
new file mode 100644
index 0000000..753bc7f
--- /dev/null
+++ b/pkg/compiler/test/deferred_loading/data/shadowed_types/main.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/*library:
+ output_units=[
+ f1: {units: [3{liba}], usedBy: [], needs: []},
+ f2: {units: [1{libb}], usedBy: [], needs: []}],
+ steps=[
+ liba=(f1),
+ libb=(f2)]
+*/
+
+import 'liba.dart' deferred as liba;
+import 'libb.dart' deferred as libb;
+import 'lib_shared.dart';
+
+/*member: main:member_unit=main{}*/
+main() async {
+ var f = /*closure_unit=main{}*/ () => libb.C();
+ print(f is C_Parent Function());
+ await liba.loadLibrary();
+ await libb.loadLibrary();
+
+ print(liba.isA(libb.createA()));
+ print(libb.createA());
+ print(libb.createC());
+ print(libb.isB(B()));
+ print(liba.isD(libb.createE()));
+ print(libb.isFWithUnused(null as dynamic));
+}
diff --git a/pkg/compiler/test/inference/data/shift_right_unsigned.dart b/pkg/compiler/test/inference/data/shift_right_unsigned.dart
index 5faf990..3518692 100644
--- a/pkg/compiler/test/inference/data/shift_right_unsigned.dart
+++ b/pkg/compiler/test/inference/data/shift_right_unsigned.dart
@@ -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.12
+// @dart = 2.13
/*member: main:[null]*/
main() {
diff --git a/pkg/compiler/test/serialization/on_disk_split_test.dart b/pkg/compiler/test/serialization/on_disk_split_test.dart
index 00ce798..22cedb1 100644
--- a/pkg/compiler/test/serialization/on_disk_split_test.dart
+++ b/pkg/compiler/test/serialization/on_disk_split_test.dart
@@ -17,17 +17,19 @@
Uri dillUri = dir.uri.resolve('out.dill');
Uri outUri = dir.uri.resolve('out.js');
var commonArgs = [
- Flags.writeData,
Flags.verbose,
'--libraries-spec=$sdkLibrariesSpecificationUri',
];
await internalMain([
'samples-dev/swarm/swarm.dart',
+ Flags.writeClosedWorld,
'--out=${dillUri}',
] +
commonArgs);
await internalMain([
'${dillUri}',
+ Flags.readClosedWorld,
+ Flags.writeData,
'--out=${outUri}',
] +
commonArgs);
diff --git a/pkg/compiler/test/serialization/serialization_test_helper.dart b/pkg/compiler/test/serialization/serialization_test_helper.dart
index b429960..b7b771c 100644
--- a/pkg/compiler/test/serialization/serialization_test_helper.dart
+++ b/pkg/compiler/test/serialization/serialization_test_helper.dart
@@ -184,7 +184,8 @@
GlobalTypeInferenceResults cloneInferenceResults(Compiler compiler,
GlobalTypeInferenceResults results, SerializationStrategy strategy) {
List<int> irData = strategy.unpackAndSerializeComponent(results);
-
+ List<int> closedWorldData =
+ strategy.serializeClosedWorld(results.closedWorld);
List<int> worldData = strategy.serializeGlobalTypeInferenceResults(results);
print('data size: ${worldData.length}');
@@ -196,6 +197,7 @@
compiler.environment,
compiler.abstractValueStrategy,
newComponent,
+ closedWorldData,
worldData);
List<int> newWorldData =
strategy.serializeGlobalTypeInferenceResults(newResults);
diff --git a/pkg/compiler/test/sourcemaps/stacktrace/extension_method.dart b/pkg/compiler/test/sourcemaps/stacktrace/extension_method.dart
index 0f6432d..5c8302a 100644
--- a/pkg/compiler/test/sourcemaps/stacktrace/extension_method.dart
+++ b/pkg/compiler/test/sourcemaps/stacktrace/extension_method.dart
@@ -1,7 +1,8 @@
+// @dart = 2.7
+
class MyClass {
MyClass();
-// @dart = 2.7
@pragma('dart2js:noInline')
set internalSetter(int v) {
/*7:MyClass.internalSetter*/ throw "error";
diff --git a/pkg/compiler/tool/modular_test_suite.dart b/pkg/compiler/tool/modular_test_suite.dart
index 0aa6ebe..780c182 100644
--- a/pkg/compiler/tool/modular_test_suite.dart
+++ b/pkg/compiler/tool/modular_test_suite.dart
@@ -54,7 +54,7 @@
new IOPipeline([
SourceToDillStep(),
ComputeClosedWorldStep(),
- GlobalAnalysisStep(),
+ LegacyGlobalAnalysisStep(),
LegacyDart2jsCodegenStep(codeId0),
LegacyDart2jsCodegenStep(codeId1),
LegacyDart2jsEmissionStep(),
@@ -312,6 +312,8 @@
for (String flag in flags) '--enable-experiment=$flag',
'${Flags.readClosedWorld}=${toUri(module, closedWorldId)}',
'${Flags.writeData}=${toUri(module, globalDataId)}',
+ // TODO(joshualitt): delete this flag after google3 roll
+ '${Flags.noClosedWorldInData}',
];
var result =
await _runProcess(Platform.resolvedExecutable, args, root.toFilePath());
@@ -425,6 +427,50 @@
}
}
+// TODO(joshualitt): delete after google3 roll.
+class LegacyGlobalAnalysisStep implements IOModularStep {
+ @override
+ List<DataId> get resultData => const [globalDataId];
+
+ @override
+ bool get needsSources => false;
+
+ @override
+ List<DataId> get dependencyDataNeeded => const [updatedDillId];
+
+ @override
+ List<DataId> get moduleDataNeeded => const [closedWorldId, updatedDillId];
+
+ @override
+ bool get onlyOnMain => true;
+
+ @override
+ Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
+ List<String> flags) async {
+ if (_options.verbose) print("\nstep: dart2js global analysis on $module");
+ List<String> args = [
+ '--packages=${sdkRoot.toFilePath()}/.packages',
+ _dart2jsScript,
+ // TODO(sigmund): remove this dependency on libraries.json
+ if (_options.useSdk) '--libraries-spec=$_librarySpecForSnapshot',
+ '${toUri(module, updatedDillId)}',
+ for (String flag in flags) '--enable-experiment=$flag',
+ '${Flags.readClosedWorld}=${toUri(module, closedWorldId)}',
+ '${Flags.writeData}=${toUri(module, globalDataId)}',
+ ];
+ var result =
+ await _runProcess(Platform.resolvedExecutable, args, root.toFilePath());
+
+ _checkExitCode(result, this, module);
+ }
+
+ @override
+ void notifyCached(Module module) {
+ if (_options.verbose)
+ print("\ncached step: dart2js global analysis on $module");
+ }
+}
+
// Step that invokes the dart2js code generation on the main module given the
// results of the global analysis step and produces one shard of the codegen
// output.
diff --git a/pkg/front_end/lib/src/api_prototype/compiler_options.dart b/pkg/front_end/lib/src/api_prototype/compiler_options.dart
index 99c4fc7..a9154dd 100644
--- a/pkg/front_end/lib/src/api_prototype/compiler_options.dart
+++ b/pkg/front_end/lib/src/api_prototype/compiler_options.dart
@@ -31,7 +31,8 @@
show
getExperimentEnabledVersionInLibrary,
isExperimentEnabled,
- isExperimentEnabledInLibrary;
+ isExperimentEnabledInLibrary,
+ isExperimentEnabledInLibraryByVersion;
import 'file_system.dart' show FileSystem;
@@ -299,6 +300,17 @@
experimentReleasedVersionForTesting);
}
+ bool isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag flag, Uri importUri, Version version) {
+ return flags.isExperimentEnabledInLibraryByVersion(flag, importUri, version,
+ explicitExperimentalFlags: explicitExperimentalFlags,
+ defaultExperimentFlagsForTesting: defaultExperimentFlagsForTesting,
+ allowedExperimentalFlags: allowedExperimentalFlagsForTesting,
+ experimentEnabledVersionForTesting: experimentEnabledVersionForTesting,
+ experimentReleasedVersionForTesting:
+ experimentReleasedVersionForTesting);
+ }
+
bool equivalent(CompilerOptions other,
{bool ignoreOnDiagnostic: true,
bool ignoreVerbose: true,
diff --git a/pkg/front_end/lib/src/api_prototype/experimental_flags.dart b/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
index 088b517..bd9a076 100644
--- a/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
+++ b/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
@@ -182,3 +182,71 @@
assert(version != null, "No version for enabling $flag in $canonicalUri.");
return version;
}
+
+bool isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag flag, Uri canonicalUri, Version version,
+ {Map<ExperimentalFlag, bool> defaultExperimentFlagsForTesting,
+ Map<ExperimentalFlag, bool> explicitExperimentalFlags,
+ AllowedExperimentalFlags allowedExperimentalFlags,
+ Map<ExperimentalFlag, Version> experimentEnabledVersionForTesting,
+ Map<ExperimentalFlag, Version> experimentReleasedVersionForTesting}) {
+ assert(defaultExperimentalFlags.containsKey(flag),
+ "No default value for $flag.");
+ assert(expiredExperimentalFlags.containsKey(flag),
+ "No expired value for $flag.");
+ if (expiredExperimentalFlags[flag]) {
+ return defaultExperimentalFlags[flag];
+ }
+
+ bool enabledByDefault;
+ if (defaultExperimentFlagsForTesting != null) {
+ enabledByDefault = defaultExperimentFlagsForTesting[flag];
+ }
+ enabledByDefault ??= defaultExperimentalFlags[flag];
+
+ bool enabledExplicitly = explicitExperimentalFlags[flag] ?? false;
+
+ allowedExperimentalFlags ??= defaultAllowedExperimentalFlags;
+
+ Set<ExperimentalFlag> allowedFlags;
+ bool enabledByAllowed = false;
+ if (canonicalUri.scheme == 'dart') {
+ allowedFlags = allowedExperimentalFlags.forSdkLibrary(canonicalUri.path);
+ } else if (canonicalUri.scheme == 'package') {
+ int index = canonicalUri.path.indexOf('/');
+ String packageName;
+ if (index >= 0) {
+ packageName = canonicalUri.path.substring(0, index);
+ } else {
+ packageName = canonicalUri.path;
+ }
+ allowedFlags = allowedExperimentalFlags.forPackage(packageName);
+ }
+ if (allowedFlags != null) {
+ enabledByAllowed = allowedFlags.contains(flag);
+ }
+
+ if (enabledByDefault || enabledExplicitly || enabledByAllowed) {
+ // The feature is enabled depending on the library language version.
+ Version enabledVersion;
+ if (!enabledByDefault || enabledExplicitly || enabledByAllowed) {
+ // If the feature is not enabled by default or is enabled by the allowed
+ // list, use the experiment release version.
+ if (experimentReleasedVersionForTesting != null) {
+ enabledVersion = experimentReleasedVersionForTesting[flag];
+ }
+ enabledVersion ??= experimentReleasedVersion[flag];
+ } else {
+ // If the feature is enabled by default and is not enabled by the allowed
+ // list use the enabled version.
+ if (experimentEnabledVersionForTesting != null) {
+ enabledVersion = experimentEnabledVersionForTesting[flag];
+ }
+ enabledVersion ??= experimentEnabledVersion[flag];
+ }
+ return version >= enabledVersion;
+ } else {
+ // The feature is not enabled, regardless of library language version.
+ return false;
+ }
+}
diff --git a/pkg/front_end/lib/src/api_prototype/language_version.dart b/pkg/front_end/lib/src/api_prototype/language_version.dart
index 84b27fd..bc5d353 100644
--- a/pkg/front_end/lib/src/api_prototype/language_version.dart
+++ b/pkg/front_end/lib/src/api_prototype/language_version.dart
@@ -147,9 +147,10 @@
if (SourceLibraryBuilder.isOptOutTest(uri)) return true;
VersionAndPackageUri versionAndLibraryUri =
await languageVersionForUri(uri, options);
- return (versionAndLibraryUri.version <
- options.getExperimentEnabledVersionInLibrary(
- ExperimentalFlag.nonNullable, versionAndLibraryUri.packageUri));
+ return !options.isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.nonNullable,
+ versionAndLibraryUri.packageUri,
+ versionAndLibraryUri.version);
}
class VersionAndPackageUri {
diff --git a/pkg/front_end/lib/src/base/processed_options.dart b/pkg/front_end/lib/src/base/processed_options.dart
index 1ea8dc4..04951b8 100644
--- a/pkg/front_end/lib/src/base/processed_options.dart
+++ b/pkg/front_end/lib/src/base/processed_options.dart
@@ -401,6 +401,11 @@
return _raw.getExperimentEnabledVersionInLibrary(flag, importUri);
}
+ bool isExperimentEnabledInLibraryByVersion(
+ flags.ExperimentalFlag flag, Uri importUri, Version version) {
+ return _raw.isExperimentEnabledInLibraryByVersion(flag, importUri, version);
+ }
+
Component _validateNullSafetyMode(Component component) {
if (component.mode == NonNullableByDefaultCompiledMode.Invalid) {
throw new FormatException(
diff --git a/pkg/front_end/lib/src/fasta/builder/library_builder.dart b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
index f318572..74355bf 100644
--- a/pkg/front_end/lib/src/fasta/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
@@ -8,7 +8,7 @@
import 'package:_fe_analyzer_shared/src/messages/severity.dart' show Severity;
-import 'package:kernel/ast.dart' show Library, Nullability, Version;
+import 'package:kernel/ast.dart' show Library, Nullability;
import '../combinator.dart' show Combinator;
@@ -55,23 +55,6 @@
bool mayImplementRestrictedTypes;
- /// Set the language version to a specific non-null [version].
- ///
- /// If the language version has previously been explicitly set set (i.e. with
- /// [explicit] set to true), any subsequent call (explicit or not) should be
- /// ignored.
- /// Multiple calls with [explicit] set to false should be allowed though.
- ///
- /// The main idea is that the .packages file specifies a default language
- /// version, but that the library can have source code that specifies another
- /// one which should be supported, but specifying several in code should not
- /// change anything.
- ///
- /// [offset] and [length] refers to the offset and length of the source code
- /// specifying the language version.
- void setLanguageVersion(Version version,
- {int offset: 0, int length, bool explicit});
-
bool get isPart;
Loader get loader;
@@ -224,27 +207,6 @@
@override
bool get isSynthetic => false;
- /// Set the language version to a specific non-null major and minor version.
- ///
- /// If [version] is null (and no other version has been explicitly set) a
- /// problem is issued.
- ///
- /// If the language version has previously been explicitly set set (i.e. with
- /// [explicit] set to true), any subsequent call (explicit or not) should be
- /// ignored.
- /// Multiple calls with [explicit] set to false should be allowed though.
- ///
- /// The main idea is that the .packages file specifies a default language
- /// version, but that the library can have source code that specifies another
- /// one which should be supported, but specifying several in code should not
- /// change anything.
- ///
- /// [offset] and [length] refers to the offset and length of the source code
- /// specifying the language version.
- @override
- void setLanguageVersion(Version version,
- {int offset: 0, int length, bool explicit});
-
@override
Builder get parent => null;
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart b/pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart
index c3813c3..27e97e4 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart
@@ -28,8 +28,7 @@
StaticGet,
StringConstant,
StringLiteral,
- Typedef,
- Version;
+ Typedef;
import '../builder/builder.dart';
import '../builder/class_builder.dart';
@@ -140,10 +139,6 @@
bool get isNonNullableByDefault => library.isNonNullableByDefault;
@override
- void setLanguageVersion(Version version,
- {int offset: 0, int length, bool explicit}) {}
-
- @override
Uri get importUri => library.importUri;
@override
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_target.dart b/pkg/front_end/lib/src/fasta/dill/dill_target.dart
index 9901f81..002f35d 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_target.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_target.dart
@@ -17,6 +17,8 @@
import '../problems.dart' show unsupported;
+import '../source/source_library_builder.dart' show LanguageVersion;
+
import '../target_implementation.dart' show TargetImplementation;
import '../ticker.dart' show Ticker;
@@ -66,6 +68,7 @@
Uri uri,
Uri fileUri,
Uri packageUri,
+ LanguageVersion packageLanguageVersion,
LibraryBuilder origin,
Library referencesFrom,
bool referenceIsPartOwner) {
diff --git a/pkg/front_end/lib/src/fasta/incremental_compiler.dart b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
index 82ba08c..a25d4e1 100644
--- a/pkg/front_end/lib/src/fasta/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
@@ -119,7 +119,8 @@
import 'library_graph.dart' show LibraryGraph;
-import 'source/source_library_builder.dart' show SourceLibraryBuilder;
+import 'source/source_library_builder.dart'
+ show ImplicitLanguageVersion, SourceLibraryBuilder;
import 'ticker.dart' show Ticker;
@@ -1883,12 +1884,12 @@
libraryUri,
debugExprUri,
/*packageUri*/ null,
+ new ImplicitLanguageVersion(libraryBuilder.library.languageVersion),
userCode.loader,
null,
scope: libraryBuilder.scope.createNestedScope("expression"),
nameOrigin: libraryBuilder.library,
);
- debugLibrary.setLanguageVersion(libraryBuilder.library.languageVersion);
ticker.logMs("Created debug library");
if (libraryBuilder is DillLibraryBuilder) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
index a178096..456dc09 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -9,38 +9,7 @@
import 'package:front_end/src/api_prototype/experimental_flags.dart';
import 'package:front_end/src/fasta/dill/dill_library_builder.dart'
show DillLibraryBuilder;
-import 'package:kernel/ast.dart'
- show
- Arguments,
- CanonicalName,
- Class,
- Component,
- Constructor,
- DartType,
- EmptyStatement,
- Expression,
- Field,
- FieldInitializer,
- FunctionNode,
- Initializer,
- InterfaceType,
- InvalidInitializer,
- InvalidType,
- Library,
- Name,
- NamedExpression,
- NonNullableByDefaultCompiledMode,
- NullLiteral,
- Procedure,
- RedirectingInitializer,
- Reference,
- Source,
- SuperInitializer,
- Supertype,
- TypeParameter,
- TypeParameterType,
- VariableDeclaration,
- VariableGet;
+import 'package:kernel/ast.dart';
import 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
import 'package:kernel/clone.dart' show CloneVisitorNotMembers;
import 'package:kernel/core_types.dart';
@@ -51,7 +20,7 @@
import 'package:kernel/transformations/value_class.dart' as valueClass;
import 'package:kernel/type_algebra.dart' show substitute;
import 'package:kernel/type_environment.dart' show TypeEnvironment;
-import 'package:package_config/package_config.dart';
+import 'package:package_config/package_config.dart' hide LanguageVersion;
import '../../api_prototype/file_system.dart' show FileSystem;
import '../../base/nnbd_mode.dart';
@@ -102,7 +71,8 @@
import '../problems.dart' show unhandled;
import '../scope.dart' show AmbiguousBuilder;
import '../source/source_class_builder.dart' show SourceClassBuilder;
-import '../source/source_library_builder.dart' show SourceLibraryBuilder;
+import '../source/source_library_builder.dart'
+ show LanguageVersion, SourceLibraryBuilder;
import '../source/source_loader.dart' show SourceLoader;
import '../target_implementation.dart' show TargetImplementation;
import '../uri_translator.dart' show UriTranslator;
@@ -246,6 +216,7 @@
Uri uri,
Uri fileUri,
Uri packageUri,
+ LanguageVersion packageLanguageVersion,
SourceLibraryBuilder origin,
Library referencesFrom,
bool referenceIsPartOwner) {
@@ -295,7 +266,8 @@
return builder;
}
}
- return new SourceLibraryBuilder(uri, fileUri, packageUri, loader, origin,
+ return new SourceLibraryBuilder(
+ uri, fileUri, packageUri, packageLanguageVersion, loader, origin,
referencesFrom: referencesFrom,
referenceIsPartOwner: referenceIsPartOwner);
}
diff --git a/pkg/front_end/lib/src/fasta/loader.dart b/pkg/front_end/lib/src/fasta/loader.dart
index 0652578..c7d3cbe 100644
--- a/pkg/front_end/lib/src/fasta/loader.dart
+++ b/pkg/front_end/lib/src/fasta/loader.dart
@@ -34,12 +34,21 @@
noLength,
SummaryTemplate,
Template,
+ messageLanguageVersionInvalidInDotPackages,
messagePlatformPrivateLibraryAccess,
templateInternalProblemContextSeverity,
+ templateLanguageVersionTooHigh,
templateSourceBodySummary;
import 'problems.dart' show internalProblem, unhandled;
+import 'source/source_library_builder.dart' as src
+ show
+ LanguageVersion,
+ InvalidLanguageVersion,
+ ImplicitLanguageVersion,
+ SourceLibraryBuilder;
+
import 'target_implementation.dart' show TargetImplementation;
import 'ticker.dart' show Ticker;
@@ -144,9 +153,9 @@
packageForLanguageVersion =
target.uriTranslator.packages.packageOf(fileUri);
}
- bool hasPackageSpecifiedLanguageVersion = false;
- Version version;
+ src.LanguageVersion packageLanguageVersion;
Uri packageUri;
+ Message packageLanguageVersionProblem;
if (packageForLanguageVersion != null) {
Uri importUri = origin?.importUri ?? uri;
if (importUri.scheme != 'dart' &&
@@ -156,24 +165,50 @@
new Uri(scheme: 'package', path: packageForLanguageVersion.name);
}
if (packageForLanguageVersion.languageVersion != null) {
- hasPackageSpecifiedLanguageVersion = true;
if (packageForLanguageVersion.languageVersion
- is! InvalidLanguageVersion) {
- version = new Version(
+ is InvalidLanguageVersion) {
+ packageLanguageVersionProblem =
+ messageLanguageVersionInvalidInDotPackages;
+ packageLanguageVersion = new src.InvalidLanguageVersion(
+ fileUri, 0, noLength, target.currentSdkVersion, false);
+ } else {
+ Version version = new Version(
packageForLanguageVersion.languageVersion.major,
packageForLanguageVersion.languageVersion.minor);
+ if (version > target.currentSdkVersion) {
+ packageLanguageVersionProblem =
+ templateLanguageVersionTooHigh.withArguments(
+ target.currentSdkVersion.major,
+ target.currentSdkVersion.minor);
+ packageLanguageVersion = new src.InvalidLanguageVersion(
+ fileUri, 0, noLength, target.currentSdkVersion, false);
+ } else {
+ packageLanguageVersion = new src.ImplicitLanguageVersion(version);
+ }
}
}
}
- LibraryBuilder library = target.createLibraryBuilder(uri, fileUri,
- packageUri, origin, referencesFrom, referenceIsPartOwner);
+ packageLanguageVersion ??=
+ new src.ImplicitLanguageVersion(target.currentSdkVersion);
+
+ LibraryBuilder library = target.createLibraryBuilder(
+ uri,
+ fileUri,
+ packageUri,
+ packageLanguageVersion,
+ origin,
+ referencesFrom,
+ referenceIsPartOwner);
if (library == null) {
throw new StateError("createLibraryBuilder for uri $uri, "
"fileUri $fileUri returned null.");
}
- if (hasPackageSpecifiedLanguageVersion) {
- library.setLanguageVersion(version, explicit: false);
+ if (packageLanguageVersionProblem != null &&
+ library is src.SourceLibraryBuilder) {
+ library.addPostponedProblem(
+ packageLanguageVersionProblem, 0, noLength, library.fileUri);
}
+
if (uri.scheme == "dart" && uri.path == "core") {
coreLibrary = library;
}
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index d13a474..eb7744b 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -231,6 +231,17 @@
List<FieldBuilder> _implicitlyTypedFields;
+ /// The language version of this library as defined by the language version
+ /// of the package it belongs to, if present, or the current language version
+ /// otherwise.
+ ///
+ /// This language version we be used as the language version for the library
+ /// if the library does not contain an explicit @dart= annotation.
+ final LanguageVersion packageLanguageVersion;
+
+ /// The actual language version of this library. This is initially the
+ /// [packageLanguageVersion] but will be updated if the library contains
+ /// an explicit @dart= language version annotation.
LanguageVersion _languageVersion;
bool postponedProblemsIssued = false;
@@ -247,6 +258,7 @@
SourceLoader loader,
Uri fileUri,
Uri packageUri,
+ LanguageVersion packageLanguageVersion,
Scope scope,
SourceLibraryBuilder actualOrigin,
Library library,
@@ -257,6 +269,7 @@
loader,
fileUri,
packageUri,
+ packageLanguageVersion,
new TypeParameterScopeBuilder.library(),
scope ?? new Scope.top(),
actualOrigin,
@@ -268,13 +281,14 @@
this.loader,
this.fileUri,
this._packageUri,
+ this.packageLanguageVersion,
this.libraryDeclaration,
this.importScope,
this.actualOrigin,
this.library,
this._nameOrigin,
this.referencesFrom)
- : _languageVersion = new ImplicitLanguageVersion(library.languageVersion),
+ : _languageVersion = packageLanguageVersion,
currentTypeParameterScopeBuilder = libraryDeclaration,
referencesFromIndexed =
referencesFrom == null ? null : new IndexedLibrary(referencesFrom),
@@ -303,17 +317,21 @@
bool _enableExtensionTypesInLibrary;
bool get enableConstFunctionsInLibrary => _enableConstFunctionsInLibrary ??=
- loader.target.isExperimentEnabledInLibrary(
- ExperimentalFlag.constFunctions, _packageUri ?? importUri);
+ loader.target.isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.constFunctions,
+ _packageUri ?? importUri,
+ languageVersion.version);
- bool get enableVarianceInLibrary =>
- _enableVarianceInLibrary ??= loader.target.isExperimentEnabledInLibrary(
- ExperimentalFlag.variance, _packageUri ?? importUri);
+ bool get enableVarianceInLibrary => _enableVarianceInLibrary ??= loader.target
+ .isExperimentEnabledInLibraryByVersion(ExperimentalFlag.variance,
+ _packageUri ?? importUri, languageVersion.version);
bool get enableNonfunctionTypeAliasesInLibrary =>
_enableNonfunctionTypeAliasesInLibrary ??= loader.target
- .isExperimentEnabledInLibrary(ExperimentalFlag.nonfunctionTypeAliases,
- _packageUri ?? importUri);
+ .isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.nonfunctionTypeAliases,
+ _packageUri ?? importUri,
+ languageVersion.version);
/// Returns `true` if the 'non-nullable' experiment is enabled for this
/// library.
@@ -331,46 +349,54 @@
ExperimentalFlag.nonNullable, _packageUri ?? importUri);
bool get enableTripleShiftInLibrary => _enableTripleShiftInLibrary ??=
- loader.target.isExperimentEnabledInLibrary(
- ExperimentalFlag.tripleShift, _packageUri ?? importUri);
+ loader.target.isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.tripleShift,
+ _packageUri ?? importUri,
+ languageVersion.version);
bool get enableExtensionMethodsInLibrary =>
_enableExtensionMethodsInLibrary ??= loader.target
- .isExperimentEnabledInLibrary(
- ExperimentalFlag.extensionMethods, _packageUri ?? importUri);
+ .isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.extensionMethods,
+ _packageUri ?? importUri,
+ languageVersion.version);
bool get enableGenericMetadataInLibrary => _enableGenericMetadataInLibrary ??=
- loader.target.isExperimentEnabledInLibrary(
- ExperimentalFlag.genericMetadata, _packageUri ?? importUri);
+ loader.target.isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.genericMetadata,
+ _packageUri ?? importUri,
+ languageVersion.version);
bool get enableExtensionTypesInLibrary => _enableExtensionTypesInLibrary ??=
- loader.target.isExperimentEnabledInLibrary(
- ExperimentalFlag.extensionTypes, _packageUri ?? importUri);
+ loader.target.isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.extensionTypes,
+ _packageUri ?? importUri,
+ languageVersion.version);
- void updateLibraryNNBDSettings() {
+ void _updateLibraryNNBDSettings() {
library.isNonNullableByDefault = isNonNullableByDefault;
- if (enableNonNullableInLibrary) {
- switch (loader.nnbdMode) {
- case NnbdMode.Weak:
- library.nonNullableByDefaultCompiledMode =
- NonNullableByDefaultCompiledMode.Weak;
- break;
- case NnbdMode.Strong:
- library.nonNullableByDefaultCompiledMode =
- NonNullableByDefaultCompiledMode.Strong;
- break;
- case NnbdMode.Agnostic:
- library.nonNullableByDefaultCompiledMode =
- NonNullableByDefaultCompiledMode.Agnostic;
- break;
- }
- } else {
- library.nonNullableByDefaultCompiledMode =
- NonNullableByDefaultCompiledMode.Weak;
+ switch (loader.nnbdMode) {
+ case NnbdMode.Weak:
+ library.nonNullableByDefaultCompiledMode =
+ NonNullableByDefaultCompiledMode.Weak;
+ break;
+ case NnbdMode.Strong:
+ library.nonNullableByDefaultCompiledMode =
+ NonNullableByDefaultCompiledMode.Strong;
+ break;
+ case NnbdMode.Agnostic:
+ library.nonNullableByDefaultCompiledMode =
+ NonNullableByDefaultCompiledMode.Agnostic;
+ break;
}
}
- SourceLibraryBuilder(Uri uri, Uri fileUri, Uri packageUri, Loader loader,
+ SourceLibraryBuilder(
+ Uri uri,
+ Uri fileUri,
+ Uri packageUri,
+ LanguageVersion packageLanguageVersion,
+ Loader loader,
SourceLibraryBuilder actualOrigin,
{Scope scope,
Library target,
@@ -381,6 +407,7 @@
loader,
fileUri,
packageUri,
+ packageLanguageVersion,
scope,
actualOrigin,
target ??
@@ -390,7 +417,7 @@
reference: referenceIsPartOwner == true
? null
: referencesFrom?.reference)
- ..setLanguageVersion(loader.target.currentSdkVersion)),
+ ..setLanguageVersion(packageLanguageVersion.version)),
nameOrigin,
referencesFrom,
referenceIsPartOwner);
@@ -425,7 +452,7 @@
bool _ensureIsNonNullableByDefault() {
if (_isNonNullableByDefault == null) {
_isNonNullableByDefault = _computeIsNonNullableByDefault();
- updateLibraryNNBDSettings();
+ _updateLibraryNNBDSettings();
}
return _isNonNullableByDefault;
}
@@ -458,9 +485,17 @@
'vm/dart_2/', // in runtime/tests
];
- LanguageVersion get languageVersion => _languageVersion;
+ LanguageVersion get languageVersion {
+ assert(
+ _languageVersion.isFinal,
+ "Attempting to read the language version of ${this} before has been "
+ "finalized.");
+ return _languageVersion;
+ }
void markLanguageVersionFinal() {
+ _languageVersion.isFinal = true;
+ _ensureIsNonNullableByDefault();
if (!isNonNullableByDefault &&
(loader.nnbdMode == NnbdMode.Strong ||
loader.nnbdMode == NnbdMode.Agnostic)) {
@@ -476,32 +511,29 @@
NonNullableByDefaultCompiledMode.Invalid;
loader.hasInvalidNnbdModeLibrary = true;
}
- _languageVersion.isFinal = true;
- _ensureIsNonNullableByDefault();
}
- @override
- void setLanguageVersion(Version version,
- {int offset: 0, int length: noLength, bool explicit: false}) {
- assert(!_languageVersion.isFinal);
- if (languageVersion.isExplicit) return;
-
- if (version == null) {
- addPostponedProblem(
- messageLanguageVersionInvalidInDotPackages, offset, length, fileUri);
- if (_languageVersion is ImplicitLanguageVersion) {
- // If the package set an OK version, but the file set an invalid version
- // we want to use the package version.
- _languageVersion = new InvalidLanguageVersion(
- fileUri, offset, length, explicit, loader.target.currentSdkVersion);
- library.setLanguageVersion(_languageVersion.version);
- }
+ /// Set the language version to an explicit major and minor version.
+ ///
+ /// The default language version specified by the .packages file is passed
+ /// to the constructor, but the library can have source code that specifies
+ /// another one which should be supported.
+ ///
+ /// Only the first registered language version is used.
+ ///
+ /// [offset] and [length] refers to the offset and length of the source code
+ /// specifying the language version.
+ void registerExplicitLanguageVersion(Version version,
+ {int offset: 0, int length: noLength}) {
+ if (_languageVersion.isExplicit) {
+ // If more than once language version exists we use the first.
return;
}
+ assert(!_languageVersion.isFinal);
- // If trying to set a language version that is higher than the current sdk
- // version it's an error.
if (version > loader.target.currentSdkVersion) {
+ // If trying to set a language version that is higher than the current sdk
+ // version it's an error.
addPostponedProblem(
templateLanguageVersionTooHigh.withArguments(
loader.target.currentSdkVersion.major,
@@ -509,19 +541,15 @@
offset,
length,
fileUri);
- if (_languageVersion is ImplicitLanguageVersion) {
- // If the package set an OK version, but the file set an invalid version
- // we want to use the package version.
- _languageVersion = new InvalidLanguageVersion(
- fileUri, offset, length, explicit, loader.target.currentSdkVersion);
- library.setLanguageVersion(_languageVersion.version);
- }
- return;
+ // If the package set an OK version, but the file set an invalid version
+ // we want to use the package version.
+ _languageVersion = new InvalidLanguageVersion(
+ fileUri, offset, length, packageLanguageVersion.version, true);
+ } else {
+ _languageVersion = new LanguageVersion(version, fileUri, offset, length);
}
-
- _languageVersion =
- new LanguageVersion(version, fileUri, offset, length, explicit);
- library.setLanguageVersion(version);
+ library.setLanguageVersion(_languageVersion.version);
+ _languageVersion.isFinal = true;
}
ConstructorReferenceBuilder addConstructorReference(Object name,
@@ -3751,6 +3779,41 @@
targetName: name.text);
}
+ void checkBoundsInFunctionInvocation(
+ TypeEnvironment typeEnvironment,
+ ClassHierarchy hierarchy,
+ TypeInferrerImpl typeInferrer,
+ FunctionType functionType,
+ String localName,
+ Arguments arguments,
+ Uri fileUri,
+ int offset) {
+ if (arguments.types.isEmpty) return;
+
+ List<TypeParameter> functionTypeParameters = functionType.typeParameters;
+ // The error is to be reported elsewhere.
+ if (functionTypeParameters.length != arguments.types.length) return;
+ final DartType bottomType = isNonNullableByDefault
+ ? const NeverType.nonNullable()
+ : const NullType();
+ List<TypeArgumentIssue> issues = findTypeArgumentIssuesForInvocation(
+ functionTypeParameters,
+ arguments.types,
+ typeEnvironment,
+ isNonNullableByDefault
+ ? SubtypeCheckMode.withNullabilities
+ : SubtypeCheckMode.ignoringNullabilities,
+ bottomType,
+ isNonNullableByDefault: library.isNonNullableByDefault,
+ areGenericArgumentsAllowed: enableGenericMetadataInLibrary);
+ reportTypeArgumentIssues(issues, fileUri, offset,
+ typeArgumentsInfo: getTypeArgumentsInfo(arguments),
+ // TODO(johnniwinther): Special-case messaging on function type
+ // invocation to avoid reference to 'call' and use the function type
+ // instead.
+ targetName: localName ?? 'call');
+ }
+
void checkTypesInOutline(TypeEnvironment typeEnvironment) {
Iterator<Builder> iterator = this.iterator;
while (iterator.moveNext()) {
@@ -4150,11 +4213,11 @@
final Uri fileUri;
final int charOffset;
final int charCount;
- final bool isExplicit;
bool isFinal = false;
- LanguageVersion(this.version, this.fileUri, this.charOffset, this.charCount,
- this.isExplicit);
+ LanguageVersion(this.version, this.fileUri, this.charOffset, this.charCount);
+
+ bool get isExplicit => true;
bool get valid => true;
@@ -4177,12 +4240,12 @@
final Uri fileUri;
final int charOffset;
final int charCount;
- final bool isExplicit;
final Version version;
+ final bool isExplicit;
bool isFinal = false;
InvalidLanguageVersion(this.fileUri, this.charOffset, this.charCount,
- this.isExplicit, this.version);
+ this.version, this.isExplicit);
@override
bool get valid => false;
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index eed0da7..29a3626 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -205,24 +205,24 @@
Future<Token> tokenize(SourceLibraryBuilder library,
{bool suppressLexicalErrors: false}) async {
- Uri uri = library.fileUri;
+ Uri fileUri = library.fileUri;
// Lookup the file URI in the cache.
- List<int> bytes = sourceBytes[uri];
+ List<int> bytes = sourceBytes[fileUri];
if (bytes == null) {
// Error recovery.
- if (uri.scheme == untranslatableUriScheme) {
+ if (fileUri.scheme == untranslatableUriScheme) {
Message message =
templateUntranslatableUri.withArguments(library.importUri);
library.addProblemAtAccessors(message);
bytes = synthesizeSourceForMissingFile(library.importUri, null);
- } else if (!uri.hasScheme) {
+ } else if (!fileUri.hasScheme) {
return internalProblem(
- templateInternalProblemUriMissingScheme.withArguments(uri),
+ templateInternalProblemUriMissingScheme.withArguments(fileUri),
-1,
library.importUri);
- } else if (uri.scheme == SourceLibraryBuilder.MALFORMED_URI_SCHEME) {
+ } else if (fileUri.scheme == SourceLibraryBuilder.MALFORMED_URI_SCHEME) {
library.addProblemAtAccessors(messageExpectedUri);
bytes = synthesizeSourceForMissingFile(library.importUri, null);
}
@@ -230,7 +230,7 @@
Uint8List zeroTerminatedBytes = new Uint8List(bytes.length + 1);
zeroTerminatedBytes.setRange(0, bytes.length, bytes);
bytes = zeroTerminatedBytes;
- sourceBytes[uri] = bytes;
+ sourceBytes[fileUri] = bytes;
}
}
@@ -239,30 +239,44 @@
// system.
List<int> rawBytes;
try {
- rawBytes = await fileSystem.entityForUri(uri).readAsBytes();
+ rawBytes = await fileSystem.entityForUri(fileUri).readAsBytes();
} on FileSystemException catch (e) {
- Message message = templateCantReadFile.withArguments(uri, e.message);
+ Message message =
+ templateCantReadFile.withArguments(fileUri, e.message);
library.addProblemAtAccessors(message);
rawBytes = synthesizeSourceForMissingFile(library.importUri, message);
}
Uint8List zeroTerminatedBytes = new Uint8List(rawBytes.length + 1);
zeroTerminatedBytes.setRange(0, rawBytes.length, rawBytes);
bytes = zeroTerminatedBytes;
- sourceBytes[uri] = bytes;
+ sourceBytes[fileUri] = bytes;
byteCount += rawBytes.length;
}
ScannerResult result = scan(bytes,
includeComments: includeComments,
configuration: new ScannerConfiguration(
- enableTripleShift: library.enableTripleShiftInLibrary,
- enableExtensionMethods: library.enableExtensionMethodsInLibrary,
- enableNonNullable: library.enableNonNullableInLibrary),
+ enableTripleShift: target.isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.tripleShift,
+ library.importUri,
+ library.packageLanguageVersion.version),
+ enableExtensionMethods:
+ target.isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.extensionMethods,
+ library.importUri,
+ library.packageLanguageVersion.version),
+ enableNonNullable: target.isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.nonNullable,
+ library.importUri,
+ library.packageLanguageVersion.version) &&
+ !SourceLibraryBuilder.isOptOutTest(library.importUri)),
languageVersionChanged:
(Scanner scanner, LanguageVersionToken version) {
if (!suppressLexicalErrors) {
- library.setLanguageVersion(new Version(version.major, version.minor),
- offset: version.offset, length: version.length, explicit: true);
+ library.registerExplicitLanguageVersion(
+ new Version(version.major, version.minor),
+ offset: version.offset,
+ length: version.length);
}
scanner.configuration = new ScannerConfiguration(
enableTripleShift: library.enableTripleShiftInLibrary,
@@ -295,7 +309,7 @@
if (!suppressLexicalErrors) {
ErrorToken error = token;
library.addProblem(error.assertionMessage, offsetForToken(token),
- lengthForToken(token), uri);
+ lengthForToken(token), fileUri);
}
token = token.next;
}
diff --git a/pkg/front_end/lib/src/fasta/target_implementation.dart b/pkg/front_end/lib/src/fasta/target_implementation.dart
index 8acd6b8..2b29da2 100644
--- a/pkg/front_end/lib/src/fasta/target_implementation.dart
+++ b/pkg/front_end/lib/src/fasta/target_implementation.dart
@@ -17,6 +17,7 @@
import 'builder/class_builder.dart';
import 'builder/library_builder.dart';
import 'builder/member_builder.dart';
+import 'source/source_library_builder.dart' show LanguageVersion;
import 'compiler_context.dart' show CompilerContext;
@@ -66,6 +67,12 @@
return _options.getExperimentEnabledVersionInLibrary(flag, importUri);
}
+ bool isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag flag, Uri importUri, Version version) {
+ return _options.isExperimentEnabledInLibraryByVersion(
+ flag, importUri, version);
+ }
+
/// Returns `true` if the [flag] is enabled by default.
bool isExperimentEnabledByDefault(ExperimentalFlag flag) {
return _options.isExperimentEnabledByDefault(flag);
@@ -100,10 +107,15 @@
/// For libraries with a 'package:' [importUri], the package path must match
/// the path in the [importUri]. For libraries with a 'dart:' [importUri] the
/// [packageUri] must be `null`.
+ ///
+ /// [packageLanguageVersion] is the language version defined by the package
+ /// which the library belongs to, or the current sdk version if the library
+ /// doesn't belong to a package.
LibraryBuilder createLibraryBuilder(
Uri uri,
Uri fileUri,
Uri packageUri,
+ LanguageVersion packageLanguageVersion,
covariant LibraryBuilder origin,
Library referencesFrom,
bool referenceIsPartOwner);
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 38e0a42..6cc44bc 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -2918,6 +2918,7 @@
receiverType: receiverType,
isImplicitCall: isImplicitCall);
Expression expression;
+ String localName;
if (useNewMethodInvocationEncoding) {
DartType inferredFunctionType = result.functionType;
if (result.isInapplicable) {
@@ -2933,6 +2934,7 @@
if (parent is FunctionDeclaration) {
assert(!identical(inferredFunctionType, unknownFunction),
"Unknown function type for local function invocation.");
+ localName = variable.name;
expression = new LocalFunctionInvocation(variable, arguments,
functionType: inferredFunctionType)
..fileOffset = receiver.fileOffset;
@@ -2951,9 +2953,22 @@
: inferredFunctionType)
..fileOffset = fileOffset;
} else {
+ if (receiver is VariableGet) {
+ VariableDeclaration variable = receiver.variable;
+ TreeNode parent = variable.parent;
+ if (parent is FunctionDeclaration) {
+ // This is a local function invocation. Use the name in bounds
+ // checking below.
+ localName = variable.name;
+ }
+ }
expression = new MethodInvocation(receiver, callName, arguments)
..fileOffset = fileOffset;
}
+
+ _checkBoundsInFunctionInvocation(
+ declaredFunctionType, localName, arguments, fileOffset);
+
Expression replacement = result.applyResult(expression);
if (!isTopLevel && target.isNullableCallFunction) {
List<LocatedMessage> context = getWhyNotPromotedContext(
@@ -3445,13 +3460,13 @@
kind, originalReceiver, originalName,
resultType: calleeType, interfaceTarget: originalTarget)
..fileOffset = fileOffset;
- flowAnalysis.propertyGet(
- originalPropertyGet, originalReceiver, originalName.text, calleeType);
} else {
originalPropertyGet =
new PropertyGet(originalReceiver, originalName, originalTarget)
..fileOffset = fileOffset;
}
+ flowAnalysis.propertyGet(
+ originalPropertyGet, originalReceiver, originalName.text, calleeType);
Expression propertyGet = originalPropertyGet;
if (receiver is! ThisExpression &&
calleeType is! DynamicType &&
@@ -3682,11 +3697,9 @@
Arguments arguments,
int fileOffset) {
// If [arguments] were inferred, check them.
- // TODO(dmitryas): Figure out why [library] is sometimes null? Answer:
- // because top level inference never got a library. This has changed so
- // we always have a library. Should we still skip this for top level
- // inference?
if (!isTopLevel) {
+ // We only perform checks in full inference.
+
// [actualReceiverType], [interfaceTarget], and [actualMethodName] below
// are for a workaround for the cases like the following:
//
@@ -3720,6 +3733,23 @@
}
}
+ void _checkBoundsInFunctionInvocation(FunctionType functionType,
+ String localName, Arguments arguments, int fileOffset) {
+ // If [arguments] were inferred, check them.
+ if (!isTopLevel) {
+ // We only perform checks in full inference.
+ library.checkBoundsInFunctionInvocation(
+ typeSchemaEnvironment,
+ classHierarchy,
+ this,
+ functionType,
+ localName,
+ arguments,
+ helper.uri,
+ fileOffset);
+ }
+ }
+
bool isSpecialCasedBinaryOperatorForReceiverType(
ObjectAccessTarget target, DartType receiverType) {
return (target.isInstanceMember ||
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index cebc0ac..17b04d6 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -786,6 +786,7 @@
UndefinedExtensionOperator/example: Fail
UndefinedExtensionSetter/analyzerCode: Fail
UndefinedExtensionSetter/example: Fail
+UnexpectedModifierInNonNnbd/part_wrapped_script: Fail # Test requires @dart= annotation
UnexpectedToken/part_wrapped_script1: Fail
UnexpectedToken/script1: Fail
UnmatchedToken/part_wrapped_script1: Fail
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index 9525c92..5599193 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -5029,8 +5029,9 @@
template: "The modifier '#lexeme' is only available in null safe libraries."
exampleAllowMoreCodes: true
analyzerCode: UNEXPECTED_TOKEN
- script:
- - "late int x;"
+ script: |
+ // @dart=2.9
+ late int x;
CompilingWithSoundNullSafety:
template: "Compiling with sound null safety"
diff --git a/pkg/front_end/test/enable_non_nullable/enable_non_nullable_test.dart b/pkg/front_end/test/enable_non_nullable/enable_non_nullable_test.dart
index 85cce5b..d95cf75 100644
--- a/pkg/front_end/test/enable_non_nullable/enable_non_nullable_test.dart
+++ b/pkg/front_end/test/enable_non_nullable/enable_non_nullable_test.dart
@@ -107,6 +107,7 @@
bool hadDiagnostic = false;
options.onDiagnostic = (DiagnosticMessage message) {
+ print(message.plainTextFormatted);
hadDiagnostic = true;
};
diff --git a/pkg/front_end/test/fasta/generator_to_string_test.dart b/pkg/front_end/test/fasta/generator_to_string_test.dart
index 88b6146..c1d32eb 100644
--- a/pkg/front_end/test/fasta/generator_to_string_test.dart
+++ b/pkg/front_end/test/fasta/generator_to_string_test.dart
@@ -27,7 +27,8 @@
TypeParameter,
VariableDeclaration,
VariableGet,
- VoidType;
+ VoidType,
+ defaultLanguageVersion;
import 'package:kernel/target/targets.dart' show NoneTarget, TargetFlags;
@@ -53,7 +54,7 @@
import 'package:front_end/src/fasta/kernel/body_builder.dart' show BodyBuilder;
import 'package:front_end/src/fasta/source/source_library_builder.dart'
- show SourceLibraryBuilder;
+ show ImplicitLanguageVersion, SourceLibraryBuilder;
void check(String expected, Generator generator) {
Expect.stringEquals(expected, "$generator");
@@ -74,6 +75,7 @@
uri,
uri,
/*packageUri*/ null,
+ new ImplicitLanguageVersion(defaultLanguageVersion),
new KernelTarget(
null,
false,
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart
index cc1f967..04a3d28 100644
--- a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// 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.9
+
const int shiftNegative1 = 2 << -1;
const int shiftNegative2 = 2 >>> -1;
const int shiftNegative3 = 2 >> -1;
@@ -23,7 +23,6 @@
const int binaryXor = 63 ^ 21;
const int binaryShift1 = 21 << 1;
-// These aren't currently defined on int :(.
const int binaryShift2 = 84 >>> 1;
const int binaryShift3 = 21 >>> 64;
@@ -36,7 +35,8 @@
const int doubleTruncateDiv = 84.2 ~/ 2;
const int doubleTruncateDivZero = 84.2 ~/ 0;
-const int doubleTruncateDivNull = 84.2 ~/ null;
+const dynamic nil = null;
+const int doubleTruncateDivNull = 84.2 ~/ nil;
const double doubleNan = 0/0;
const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.textual_outline.expect b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.textual_outline.expect
index 4be3a27..4a2cf37 100644
--- a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.textual_outline.expect
@@ -1,4 +1,3 @@
-// @dart = 2.9
const int shiftNegative1 = 2 << -1;
const int shiftNegative2 = 2 >>> -1;
const int shiftNegative3 = 2 >> -1;
@@ -28,7 +27,8 @@
const bool binaryGreater = 42 > 42;
const int doubleTruncateDiv = 84.2 ~/ 2;
const int doubleTruncateDivZero = 84.2 ~/ 0;
-const int doubleTruncateDivNull = 84.2 ~/ null;
+const dynamic nil = null;
+const int doubleTruncateDivNull = 84.2 ~/ nil;
const double doubleNan = 0/0;
const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
const int bigNumber = 0x8000000000000000;
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.expect b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.expect
index bb1a380..e2269a8 100644
--- a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.expect
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -61,24 +61,24 @@
// const int intdivZero = 2 ~/ 0;
// ^
//
-// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:38:40: Error: Constant evaluation error:
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:37:40: Error: Constant evaluation error:
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
-// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:38:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:37:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
-// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:38:11: Context: While analyzing:
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:37:11: Context: While analyzing:
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
//
// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:39:40: Error: Constant evaluation error:
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:39:40: Context: Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:39:11: Context: While analyzing:
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
//
// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:41:39: Error: Constant evaluation error:
@@ -94,43 +94,44 @@
import self as self;
import "dart:core" as core;
-static const field core::int* shiftNegative1 = invalid-expression "Binary operator '<<' on '2.0' requires non-negative operand, but was '-1.0'.";
-static const field core::int* shiftNegative2 = invalid-expression "Binary operator '>>>' on '2.0' requires non-negative operand, but was '-1.0'.";
-static const field core::int* shiftNegative3 = invalid-expression "Binary operator '>>' on '2.0' requires non-negative operand, but was '-1.0'.";
-static const field core::int* modZero = invalid-expression "Binary operator '%' on '2.0' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* divZero = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+static const field core::int shiftNegative1 = invalid-expression "Binary operator '<<' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int shiftNegative2 = invalid-expression "Binary operator '>>>' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int shiftNegative3 = invalid-expression "Binary operator '>>' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int modZero = invalid-expression "Binary operator '%' on '2.0' requires non-zero divisor, but divisor was '0'.";
+static const field core::int divZero = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
const int divZero = 2 / 0;
^";
-static const field core::int* intdivZero = invalid-expression "Binary operator '~/' on '2.0' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* unaryMinus = #C1;
-static const field core::int* unaryTilde = #C2;
-static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:13:23: Error: This couldn't be parsed.
+static const field core::int intdivZero = invalid-expression "Binary operator '~/' on '2.0' requires non-zero divisor, but divisor was '0'.";
+static const field core::int unaryMinus = #C1;
+static const field core::int unaryTilde = #C2;
+static const field core::int unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:13:23: Error: This couldn't be parsed.
const int unaryPlus = +2;
^";
-static const field core::int* binaryPlus = #C3;
-static const field core::int* binaryMinus = #C3;
-static const field core::int* binaryTimes = #C3;
-static const field core::double* binaryDiv = #C3;
-static const field core::int* binaryTildeDiv = #C3;
-static const field core::int* binaryMod = #C3;
-static const field core::int* binaryOr = #C3;
-static const field core::int* binaryAnd = #C3;
-static const field core::int* binaryXor = #C3;
-static const field core::int* binaryShift1 = #C3;
-static const field core::int* binaryShift2 = #C3;
-static const field core::int* binaryShift3 = #C4;
-static const field core::int* binaryShift4 = #C3;
-static const field core::int* binaryShift5 = #C5;
-static const field core::bool* binaryLess = #C6;
-static const field core::bool* binaryLessEqual = #C7;
-static const field core::bool* binaryGreaterEqual = #C7;
-static const field core::bool* binaryGreater = #C6;
-static const field core::int* doubleTruncateDiv = #C3;
-static const field core::int* doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
-static const field core::double* doubleNan = #C8;
-static const field core::int* doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
-static const field core::int* bigNumber = #C9;
+static const field core::int binaryPlus = #C3;
+static const field core::int binaryMinus = #C3;
+static const field core::int binaryTimes = #C3;
+static const field core::double binaryDiv = #C3;
+static const field core::int binaryTildeDiv = #C3;
+static const field core::int binaryMod = #C3;
+static const field core::int binaryOr = #C3;
+static const field core::int binaryAnd = #C3;
+static const field core::int binaryXor = #C3;
+static const field core::int binaryShift1 = #C3;
+static const field core::int binaryShift2 = #C3;
+static const field core::int binaryShift3 = #C4;
+static const field core::int binaryShift4 = #C3;
+static const field core::int binaryShift5 = #C5;
+static const field core::bool binaryLess = #C6;
+static const field core::bool binaryLessEqual = #C7;
+static const field core::bool binaryGreaterEqual = #C7;
+static const field core::bool binaryGreater = #C6;
+static const field core::int doubleTruncateDiv = #C3;
+static const field core::int doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
+static const field dynamic nil = #C8;
+static const field core::int doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
+static const field core::double doubleNan = #C9;
+static const field core::int doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
+static const field core::int bigNumber = #C10;
static method main() → dynamic {}
constants {
@@ -141,6 +142,7 @@
#C5 = 4294967295.0
#C6 = false
#C7 = true
- #C8 = NaN
- #C9 = 9223372036854776000.0
+ #C8 = null
+ #C9 = NaN
+ #C10 = 9223372036854776000.0
}
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.outline.expect b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.outline.expect
index 3efcc8e..2aa115c 100644
--- a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.outline.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -14,43 +14,44 @@
import self as self;
import "dart:core" as core;
-static const field core::int* shiftNegative1 = 2.{core::int::<<}(1.{core::int::unary-}(){() →* core::int*}){(core::int*) →* core::int*};
-static const field core::int* shiftNegative2 = 2.{core::int::>>>}(1.{core::int::unary-}(){() →* core::int*}){(core::int*) →* core::int*};
-static const field core::int* shiftNegative3 = 2.{core::int::>>}(1.{core::int::unary-}(){() →* core::int*}){(core::int*) →* core::int*};
-static const field core::int* modZero = 2.{core::num::%}(0){(core::num*) →* core::int*};
-static const field core::int* divZero = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+static const field core::int shiftNegative1 = 2.{core::int::<<}(1.{core::int::unary-}(){() → core::int}){(core::int) → core::int};
+static const field core::int shiftNegative2 = 2.{core::int::>>>}(1.{core::int::unary-}(){() → core::int}){(core::int) → core::int};
+static const field core::int shiftNegative3 = 2.{core::int::>>}(1.{core::int::unary-}(){() → core::int}){(core::int) → core::int};
+static const field core::int modZero = 2.{core::num::%}(0){(core::num) → core::int};
+static const field core::int divZero = let final Never #t1 = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
const int divZero = 2 / 0;
- ^" in 2.{core::num::/}(0){(core::num*) →* core::double*} as{TypeError} core::int*;
-static const field core::int* intdivZero = 2.{core::num::~/}(0){(core::num*) →* core::int*};
-static const field core::int* unaryMinus = 2.{core::int::unary-}(){() →* core::int*};
-static const field core::int* unaryTilde = 2.{core::int::~}(){() →* core::int*};
-static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:13:23: Error: This couldn't be parsed.
+ ^" in 2.{core::num::/}(0){(core::num) → core::double} as{TypeError,ForNonNullableByDefault} core::int;
+static const field core::int intdivZero = 2.{core::num::~/}(0){(core::num) → core::int};
+static const field core::int unaryMinus = 2.{core::int::unary-}(){() → core::int};
+static const field core::int unaryTilde = 2.{core::int::~}(){() → core::int};
+static const field core::int unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:13:23: Error: This couldn't be parsed.
const int unaryPlus = +2;
- ^"{dynamic}.+(2) as{TypeError,ForDynamic} core::int*;
-static const field core::int* binaryPlus = 40.{core::num::+}(2){(core::num*) →* core::int*};
-static const field core::int* binaryMinus = 44.{core::num::-}(2){(core::num*) →* core::int*};
-static const field core::int* binaryTimes = 21.{core::num::*}(2){(core::num*) →* core::int*};
-static const field core::double* binaryDiv = 84.{core::num::/}(2){(core::num*) →* core::double*};
-static const field core::int* binaryTildeDiv = 84.{core::num::~/}(2){(core::num*) →* core::int*};
-static const field core::int* binaryMod = 85.{core::num::%}(43){(core::num*) →* core::int*};
-static const field core::int* binaryOr = 32.{core::int::|}(10){(core::int*) →* core::int*};
-static const field core::int* binaryAnd = 63.{core::int::&}(106){(core::int*) →* core::int*};
-static const field core::int* binaryXor = 63.{core::int::^}(21){(core::int*) →* core::int*};
-static const field core::int* binaryShift1 = 21.{core::int::<<}(1){(core::int*) →* core::int*};
-static const field core::int* binaryShift2 = 84.{core::int::>>>}(1){(core::int*) →* core::int*};
-static const field core::int* binaryShift3 = 21.{core::int::>>>}(64){(core::int*) →* core::int*};
-static const field core::int* binaryShift4 = 84.{core::int::>>}(1){(core::int*) →* core::int*};
-static const field core::int* binaryShift5 = 1.{core::int::unary-}(){() →* core::int*}.{core::int::>>}(1){(core::int*) →* core::int*};
-static const field core::bool* binaryLess = 42.{core::num::<}(42){(core::num*) →* core::bool*};
-static const field core::bool* binaryLessEqual = 42.{core::num::<=}(42){(core::num*) →* core::bool*};
-static const field core::bool* binaryGreaterEqual = 42.{core::num::>=}(42){(core::num*) →* core::bool*};
-static const field core::bool* binaryGreater = 42.{core::num::>}(42){(core::num*) →* core::bool*};
-static const field core::int* doubleTruncateDiv = 84.2.{core::double::~/}(2){(core::num*) →* core::int*};
-static const field core::int* doubleTruncateDivZero = 84.2.{core::double::~/}(0){(core::num*) →* core::int*};
-static const field core::int* doubleTruncateDivNull = 84.2.{core::double::~/}(null){(core::num*) →* core::int*};
-static const field core::double* doubleNan = 0.{core::num::/}(0){(core::num*) →* core::double*};
-static const field core::int* doubleTruncateDivNaN = 84.2.{core::double::~/}(self::doubleNan){(core::num*) →* core::int*};
-static const field core::int* bigNumber = -9223372036854775808;
+ ^"{dynamic}.+(2) as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
+static const field core::int binaryPlus = 40.{core::num::+}(2){(core::num) → core::int};
+static const field core::int binaryMinus = 44.{core::num::-}(2){(core::num) → core::int};
+static const field core::int binaryTimes = 21.{core::num::*}(2){(core::num) → core::int};
+static const field core::double binaryDiv = 84.{core::num::/}(2){(core::num) → core::double};
+static const field core::int binaryTildeDiv = 84.{core::num::~/}(2){(core::num) → core::int};
+static const field core::int binaryMod = 85.{core::num::%}(43){(core::num) → core::int};
+static const field core::int binaryOr = 32.{core::int::|}(10){(core::int) → core::int};
+static const field core::int binaryAnd = 63.{core::int::&}(106){(core::int) → core::int};
+static const field core::int binaryXor = 63.{core::int::^}(21){(core::int) → core::int};
+static const field core::int binaryShift1 = 21.{core::int::<<}(1){(core::int) → core::int};
+static const field core::int binaryShift2 = 84.{core::int::>>>}(1){(core::int) → core::int};
+static const field core::int binaryShift3 = 21.{core::int::>>>}(64){(core::int) → core::int};
+static const field core::int binaryShift4 = 84.{core::int::>>}(1){(core::int) → core::int};
+static const field core::int binaryShift5 = 1.{core::int::unary-}(){() → core::int}.{core::int::>>}(1){(core::int) → core::int};
+static const field core::bool binaryLess = 42.{core::num::<}(42){(core::num) → core::bool};
+static const field core::bool binaryLessEqual = 42.{core::num::<=}(42){(core::num) → core::bool};
+static const field core::bool binaryGreaterEqual = 42.{core::num::>=}(42){(core::num) → core::bool};
+static const field core::bool binaryGreater = 42.{core::num::>}(42){(core::num) → core::bool};
+static const field core::int doubleTruncateDiv = 84.2.{core::double::~/}(2){(core::num) → core::int};
+static const field core::int doubleTruncateDivZero = 84.2.{core::double::~/}(0){(core::num) → core::int};
+static const field dynamic nil = null;
+static const field core::int doubleTruncateDivNull = 84.2.{core::double::~/}(self::nil as{TypeError,ForDynamic,ForNonNullableByDefault} core::num){(core::num) → core::int};
+static const field core::double doubleNan = 0.{core::num::/}(0){(core::num) → core::double};
+static const field core::int doubleTruncateDivNaN = 84.2.{core::double::~/}(self::doubleNan){(core::num) → core::int};
+static const field core::int bigNumber = -9223372036854775808;
static method main() → dynamic
;
@@ -72,15 +73,16 @@
Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:22:26 -> DoubleConstant(42.0)
Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:23:26 -> DoubleConstant(42.0)
Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:24:29 -> DoubleConstant(42.0)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:27:29 -> DoubleConstant(42.0)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:28:29 -> DoubleConstant(0.0)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:30:29 -> DoubleConstant(42.0)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:31:29 -> DoubleConstant(4294967295.0)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:32:28 -> BoolConstant(false)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:33:33 -> BoolConstant(true)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:34:36 -> BoolConstant(true)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:35:31 -> BoolConstant(false)
-Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:37:36 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:26:29 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:27:29 -> DoubleConstant(0.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:29:29 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:30:29 -> DoubleConstant(4294967295.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:31:28 -> BoolConstant(false)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:32:33 -> BoolConstant(true)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:33:36 -> BoolConstant(true)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:34:31 -> BoolConstant(false)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:36:36 -> DoubleConstant(42.0)
+Evaluated: AsExpression @ org-dartlang-testcase:///number_folds.dart:39:43 -> NullConstant(null)
Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds.dart:40:27 -> DoubleConstant(NaN)
Evaluated: StaticGet @ org-dartlang-testcase:///number_folds.dart:41:42 -> DoubleConstant(NaN)
-Extra constant evaluation: evaluated: 39, effectively constant: 27
+Extra constant evaluation: evaluated: 40, effectively constant: 28
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.transformed.expect b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.transformed.expect
index bb1a380..e2269a8 100644
--- a/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart.weak.transformed.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -61,24 +61,24 @@
// const int intdivZero = 2 ~/ 0;
// ^
//
-// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:38:40: Error: Constant evaluation error:
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:37:40: Error: Constant evaluation error:
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
-// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:38:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:37:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
-// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:38:11: Context: While analyzing:
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:37:11: Context: While analyzing:
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
//
// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:39:40: Error: Constant evaluation error:
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:39:40: Context: Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:39:11: Context: While analyzing:
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
//
// pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:41:39: Error: Constant evaluation error:
@@ -94,43 +94,44 @@
import self as self;
import "dart:core" as core;
-static const field core::int* shiftNegative1 = invalid-expression "Binary operator '<<' on '2.0' requires non-negative operand, but was '-1.0'.";
-static const field core::int* shiftNegative2 = invalid-expression "Binary operator '>>>' on '2.0' requires non-negative operand, but was '-1.0'.";
-static const field core::int* shiftNegative3 = invalid-expression "Binary operator '>>' on '2.0' requires non-negative operand, but was '-1.0'.";
-static const field core::int* modZero = invalid-expression "Binary operator '%' on '2.0' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* divZero = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+static const field core::int shiftNegative1 = invalid-expression "Binary operator '<<' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int shiftNegative2 = invalid-expression "Binary operator '>>>' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int shiftNegative3 = invalid-expression "Binary operator '>>' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int modZero = invalid-expression "Binary operator '%' on '2.0' requires non-zero divisor, but divisor was '0'.";
+static const field core::int divZero = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
const int divZero = 2 / 0;
^";
-static const field core::int* intdivZero = invalid-expression "Binary operator '~/' on '2.0' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* unaryMinus = #C1;
-static const field core::int* unaryTilde = #C2;
-static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:13:23: Error: This couldn't be parsed.
+static const field core::int intdivZero = invalid-expression "Binary operator '~/' on '2.0' requires non-zero divisor, but divisor was '0'.";
+static const field core::int unaryMinus = #C1;
+static const field core::int unaryTilde = #C2;
+static const field core::int unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds.dart:13:23: Error: This couldn't be parsed.
const int unaryPlus = +2;
^";
-static const field core::int* binaryPlus = #C3;
-static const field core::int* binaryMinus = #C3;
-static const field core::int* binaryTimes = #C3;
-static const field core::double* binaryDiv = #C3;
-static const field core::int* binaryTildeDiv = #C3;
-static const field core::int* binaryMod = #C3;
-static const field core::int* binaryOr = #C3;
-static const field core::int* binaryAnd = #C3;
-static const field core::int* binaryXor = #C3;
-static const field core::int* binaryShift1 = #C3;
-static const field core::int* binaryShift2 = #C3;
-static const field core::int* binaryShift3 = #C4;
-static const field core::int* binaryShift4 = #C3;
-static const field core::int* binaryShift5 = #C5;
-static const field core::bool* binaryLess = #C6;
-static const field core::bool* binaryLessEqual = #C7;
-static const field core::bool* binaryGreaterEqual = #C7;
-static const field core::bool* binaryGreater = #C6;
-static const field core::int* doubleTruncateDiv = #C3;
-static const field core::int* doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
-static const field core::double* doubleNan = #C8;
-static const field core::int* doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
-static const field core::int* bigNumber = #C9;
+static const field core::int binaryPlus = #C3;
+static const field core::int binaryMinus = #C3;
+static const field core::int binaryTimes = #C3;
+static const field core::double binaryDiv = #C3;
+static const field core::int binaryTildeDiv = #C3;
+static const field core::int binaryMod = #C3;
+static const field core::int binaryOr = #C3;
+static const field core::int binaryAnd = #C3;
+static const field core::int binaryXor = #C3;
+static const field core::int binaryShift1 = #C3;
+static const field core::int binaryShift2 = #C3;
+static const field core::int binaryShift3 = #C4;
+static const field core::int binaryShift4 = #C3;
+static const field core::int binaryShift5 = #C5;
+static const field core::bool binaryLess = #C6;
+static const field core::bool binaryLessEqual = #C7;
+static const field core::bool binaryGreaterEqual = #C7;
+static const field core::bool binaryGreater = #C6;
+static const field core::int doubleTruncateDiv = #C3;
+static const field core::int doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
+static const field dynamic nil = #C8;
+static const field core::int doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
+static const field core::double doubleNan = #C9;
+static const field core::int doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
+static const field core::int bigNumber = #C10;
static method main() → dynamic {}
constants {
@@ -141,6 +142,7 @@
#C5 = 4294967295.0
#C6 = false
#C7 = true
- #C8 = NaN
- #C9 = 9223372036854776000.0
+ #C8 = null
+ #C9 = NaN
+ #C10 = 9223372036854776000.0
}
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart
new file mode 100644
index 0000000..90f02de
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.9
+
+const int shiftNegative1 = 2 << -1;
+const int shiftNegative3 = 2 >> -1;
+const int modZero = 2 % 0;
+const int divZero = 2 / 0;
+const int intdivZero = 2 ~/ 0;
+const int unaryMinus = -2;
+const int unaryTilde = ~2;
+const int unaryPlus = +2;
+
+const int binaryPlus = 40 + 2;
+const int binaryMinus = 44 - 2;
+const int binaryTimes = 21 * 2;
+const double binaryDiv = 84 / 2;
+const int binaryTildeDiv = 84~/ 2;
+const int binaryMod = 85 % 43;
+const int binaryOr = 32 | 10;
+const int binaryAnd = 63 & 106;
+const int binaryXor = 63 ^ 21;
+const int binaryShift1 = 21 << 1;
+
+const int binaryShift4 = 84 >> 1;
+const int binaryShift5 = -1 >> 1;
+const bool binaryLess = 42 < 42;
+const bool binaryLessEqual = 42 <= 42;
+const bool binaryGreaterEqual = 42 >= 42;
+const bool binaryGreater = 42 > 42;
+
+const int doubleTruncateDiv = 84.2 ~/ 2;
+const int doubleTruncateDivZero = 84.2 ~/ 0;
+const int doubleTruncateDivNull = 84.2 ~/ null;
+const double doubleNan = 0/0;
+const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+
+const int bigNumber = 0x8000000000000000;
+
+main() {
+
+}
\ No newline at end of file
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.textual_outline.expect b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.textual_outline.expect
new file mode 100644
index 0000000..7f22f68
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.textual_outline.expect
@@ -0,0 +1,32 @@
+// @dart = 2.9
+const int shiftNegative1 = 2 << -1;
+const int shiftNegative3 = 2 >> -1;
+const int modZero = 2 % 0;
+const int divZero = 2 / 0;
+const int intdivZero = 2 ~/ 0;
+const int unaryMinus = -2;
+const int unaryTilde = ~2;
+const int unaryPlus = +2;
+const int binaryPlus = 40 + 2;
+const int binaryMinus = 44 - 2;
+const int binaryTimes = 21 * 2;
+const double binaryDiv = 84 / 2;
+const int binaryTildeDiv = 84~/ 2;
+const int binaryMod = 85 % 43;
+const int binaryOr = 32 | 10;
+const int binaryAnd = 63 & 106;
+const int binaryXor = 63 ^ 21;
+const int binaryShift1 = 21 << 1;
+const int binaryShift4 = 84 >> 1;
+const int binaryShift5 = -1 >> 1;
+const bool binaryLess = 42 < 42;
+const bool binaryLessEqual = 42 <= 42;
+const bool binaryGreaterEqual = 42 >= 42;
+const bool binaryGreater = 42 > 42;
+const int doubleTruncateDiv = 84.2 ~/ 2;
+const int doubleTruncateDivZero = 84.2 ~/ 0;
+const int doubleTruncateDivNull = 84.2 ~/ null;
+const double doubleNan = 0/0;
+const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+const int bigNumber = 0x8000000000000000;
+main() {}
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.expect b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.expect
new file mode 100644
index 0000000..220b700
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.expect
@@ -0,0 +1,132 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:14:23: Error: '+' is not a prefix operator.
+// Try removing '+'.
+// const int unaryPlus = +2;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+// const int divZero = 2 / 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:7:30: Error: Constant evaluation error:
+// const int shiftNegative1 = 2 << -1;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:7:30: Context: Binary operator '<<' on '2.0' requires non-negative operand, but was '-1.0'.
+// const int shiftNegative1 = 2 << -1;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:7:11: Context: While analyzing:
+// const int shiftNegative1 = 2 << -1;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:8:30: Error: Constant evaluation error:
+// const int shiftNegative3 = 2 >> -1;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:8:30: Context: Binary operator '>>' on '2.0' requires non-negative operand, but was '-1.0'.
+// const int shiftNegative3 = 2 >> -1;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:8:11: Context: While analyzing:
+// const int shiftNegative3 = 2 >> -1;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:9:23: Error: Constant evaluation error:
+// const int modZero = 2 % 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:9:23: Context: Binary operator '%' on '2.0' requires non-zero divisor, but divisor was '0'.
+// const int modZero = 2 % 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:9:11: Context: While analyzing:
+// const int modZero = 2 % 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:11:26: Error: Constant evaluation error:
+// const int intdivZero = 2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:11:26: Context: Binary operator '~/' on '2.0' requires non-zero divisor, but divisor was '0'.
+// const int intdivZero = 2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:11:11: Context: While analyzing:
+// const int intdivZero = 2 ~/ 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:35:40: Error: Constant evaluation error:
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:35:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:35:11: Context: While analyzing:
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:36:40: Error: Constant evaluation error:
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:36:40: Context: Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:36:11: Context: While analyzing:
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:38:39: Error: Constant evaluation error:
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:38:39: Context: Binary operator '84.2 ~/ NaN' results is Infinity or NaN.
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:38:11: Context: While analyzing:
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+static const field core::int* shiftNegative1 = invalid-expression "Binary operator '<<' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int* shiftNegative3 = invalid-expression "Binary operator '>>' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int* modZero = invalid-expression "Binary operator '%' on '2.0' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* divZero = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+const int divZero = 2 / 0;
+ ^";
+static const field core::int* intdivZero = invalid-expression "Binary operator '~/' on '2.0' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* unaryMinus = #C1;
+static const field core::int* unaryTilde = #C2;
+static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:14:23: Error: This couldn't be parsed.
+const int unaryPlus = +2;
+ ^";
+static const field core::int* binaryPlus = #C3;
+static const field core::int* binaryMinus = #C3;
+static const field core::int* binaryTimes = #C3;
+static const field core::double* binaryDiv = #C3;
+static const field core::int* binaryTildeDiv = #C3;
+static const field core::int* binaryMod = #C3;
+static const field core::int* binaryOr = #C3;
+static const field core::int* binaryAnd = #C3;
+static const field core::int* binaryXor = #C3;
+static const field core::int* binaryShift1 = #C3;
+static const field core::int* binaryShift4 = #C3;
+static const field core::int* binaryShift5 = #C4;
+static const field core::bool* binaryLess = #C5;
+static const field core::bool* binaryLessEqual = #C6;
+static const field core::bool* binaryGreaterEqual = #C6;
+static const field core::bool* binaryGreater = #C5;
+static const field core::int* doubleTruncateDiv = #C3;
+static const field core::int* doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
+static const field core::double* doubleNan = #C7;
+static const field core::int* doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
+static const field core::int* bigNumber = #C8;
+static method main() → dynamic {}
+
+constants {
+ #C1 = -2.0
+ #C2 = 4294967293.0
+ #C3 = 42.0
+ #C4 = 4294967295.0
+ #C5 = false
+ #C6 = true
+ #C7 = NaN
+ #C8 = 9223372036854776000.0
+}
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.outline.expect b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.outline.expect
new file mode 100644
index 0000000..92d8300
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.outline.expect
@@ -0,0 +1,80 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:14:23: Error: '+' is not a prefix operator.
+// Try removing '+'.
+// const int unaryPlus = +2;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+// const int divZero = 2 / 0;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+static const field core::int* shiftNegative1 = 2.{core::int::<<}(1.{core::int::unary-}(){() →* core::int*}){(core::int*) →* core::int*};
+static const field core::int* shiftNegative3 = 2.{core::int::>>}(1.{core::int::unary-}(){() →* core::int*}){(core::int*) →* core::int*};
+static const field core::int* modZero = 2.{core::num::%}(0){(core::num*) →* core::int*};
+static const field core::int* divZero = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+const int divZero = 2 / 0;
+ ^" in 2.{core::num::/}(0){(core::num*) →* core::double*} as{TypeError} core::int*;
+static const field core::int* intdivZero = 2.{core::num::~/}(0){(core::num*) →* core::int*};
+static const field core::int* unaryMinus = 2.{core::int::unary-}(){() →* core::int*};
+static const field core::int* unaryTilde = 2.{core::int::~}(){() →* core::int*};
+static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:14:23: Error: This couldn't be parsed.
+const int unaryPlus = +2;
+ ^"{dynamic}.+(2) as{TypeError,ForDynamic} core::int*;
+static const field core::int* binaryPlus = 40.{core::num::+}(2){(core::num*) →* core::int*};
+static const field core::int* binaryMinus = 44.{core::num::-}(2){(core::num*) →* core::int*};
+static const field core::int* binaryTimes = 21.{core::num::*}(2){(core::num*) →* core::int*};
+static const field core::double* binaryDiv = 84.{core::num::/}(2){(core::num*) →* core::double*};
+static const field core::int* binaryTildeDiv = 84.{core::num::~/}(2){(core::num*) →* core::int*};
+static const field core::int* binaryMod = 85.{core::num::%}(43){(core::num*) →* core::int*};
+static const field core::int* binaryOr = 32.{core::int::|}(10){(core::int*) →* core::int*};
+static const field core::int* binaryAnd = 63.{core::int::&}(106){(core::int*) →* core::int*};
+static const field core::int* binaryXor = 63.{core::int::^}(21){(core::int*) →* core::int*};
+static const field core::int* binaryShift1 = 21.{core::int::<<}(1){(core::int*) →* core::int*};
+static const field core::int* binaryShift4 = 84.{core::int::>>}(1){(core::int*) →* core::int*};
+static const field core::int* binaryShift5 = 1.{core::int::unary-}(){() →* core::int*}.{core::int::>>}(1){(core::int*) →* core::int*};
+static const field core::bool* binaryLess = 42.{core::num::<}(42){(core::num*) →* core::bool*};
+static const field core::bool* binaryLessEqual = 42.{core::num::<=}(42){(core::num*) →* core::bool*};
+static const field core::bool* binaryGreaterEqual = 42.{core::num::>=}(42){(core::num*) →* core::bool*};
+static const field core::bool* binaryGreater = 42.{core::num::>}(42){(core::num*) →* core::bool*};
+static const field core::int* doubleTruncateDiv = 84.2.{core::double::~/}(2){(core::num*) →* core::int*};
+static const field core::int* doubleTruncateDivZero = 84.2.{core::double::~/}(0){(core::num*) →* core::int*};
+static const field core::int* doubleTruncateDivNull = 84.2.{core::double::~/}(null){(core::num*) →* core::int*};
+static const field core::double* doubleNan = 0.{core::num::/}(0){(core::num*) →* core::double*};
+static const field core::int* doubleTruncateDivNaN = 84.2.{core::double::~/}(self::doubleNan){(core::num*) →* core::int*};
+static const field core::int* bigNumber = -9223372036854775808;
+static method main() → dynamic
+ ;
+
+
+Extra constant evaluation status:
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:7:33 -> DoubleConstant(-1.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:8:33 -> DoubleConstant(-1.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:10:23 -> DoubleConstant(Infinity)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:12:24 -> DoubleConstant(-2.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:13:24 -> DoubleConstant(4294967293.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:16:27 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:17:28 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:18:28 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:19:29 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:20:30 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:21:26 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:22:25 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:23:26 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:24:26 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:25:29 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:27:29 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:28:29 -> DoubleConstant(4294967295.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:29:28 -> BoolConstant(false)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:30:33 -> BoolConstant(true)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:31:36 -> BoolConstant(true)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:32:31 -> BoolConstant(false)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:34:36 -> DoubleConstant(42.0)
+Evaluated: InstanceInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:37:27 -> DoubleConstant(NaN)
+Evaluated: StaticGet @ org-dartlang-testcase:///number_folds_opt_out.dart:38:42 -> DoubleConstant(NaN)
+Extra constant evaluation: evaluated: 35, effectively constant: 24
diff --git a/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.transformed.expect b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.transformed.expect
new file mode 100644
index 0000000..220b700
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart.weak.transformed.expect
@@ -0,0 +1,132 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:14:23: Error: '+' is not a prefix operator.
+// Try removing '+'.
+// const int unaryPlus = +2;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+// const int divZero = 2 / 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:7:30: Error: Constant evaluation error:
+// const int shiftNegative1 = 2 << -1;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:7:30: Context: Binary operator '<<' on '2.0' requires non-negative operand, but was '-1.0'.
+// const int shiftNegative1 = 2 << -1;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:7:11: Context: While analyzing:
+// const int shiftNegative1 = 2 << -1;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:8:30: Error: Constant evaluation error:
+// const int shiftNegative3 = 2 >> -1;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:8:30: Context: Binary operator '>>' on '2.0' requires non-negative operand, but was '-1.0'.
+// const int shiftNegative3 = 2 >> -1;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:8:11: Context: While analyzing:
+// const int shiftNegative3 = 2 >> -1;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:9:23: Error: Constant evaluation error:
+// const int modZero = 2 % 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:9:23: Context: Binary operator '%' on '2.0' requires non-zero divisor, but divisor was '0'.
+// const int modZero = 2 % 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:9:11: Context: While analyzing:
+// const int modZero = 2 % 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:11:26: Error: Constant evaluation error:
+// const int intdivZero = 2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:11:26: Context: Binary operator '~/' on '2.0' requires non-zero divisor, but divisor was '0'.
+// const int intdivZero = 2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:11:11: Context: While analyzing:
+// const int intdivZero = 2 ~/ 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:35:40: Error: Constant evaluation error:
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:35:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:35:11: Context: While analyzing:
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:36:40: Error: Constant evaluation error:
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:36:40: Context: Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:36:11: Context: While analyzing:
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+//
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:38:39: Error: Constant evaluation error:
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:38:39: Context: Binary operator '84.2 ~/ NaN' results is Infinity or NaN.
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+// pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:38:11: Context: While analyzing:
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+static const field core::int* shiftNegative1 = invalid-expression "Binary operator '<<' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int* shiftNegative3 = invalid-expression "Binary operator '>>' on '2.0' requires non-negative operand, but was '-1.0'.";
+static const field core::int* modZero = invalid-expression "Binary operator '%' on '2.0' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* divZero = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+const int divZero = 2 / 0;
+ ^";
+static const field core::int* intdivZero = invalid-expression "Binary operator '~/' on '2.0' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* unaryMinus = #C1;
+static const field core::int* unaryTilde = #C2;
+static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/js_semantics/number_folds_opt_out.dart:14:23: Error: This couldn't be parsed.
+const int unaryPlus = +2;
+ ^";
+static const field core::int* binaryPlus = #C3;
+static const field core::int* binaryMinus = #C3;
+static const field core::int* binaryTimes = #C3;
+static const field core::double* binaryDiv = #C3;
+static const field core::int* binaryTildeDiv = #C3;
+static const field core::int* binaryMod = #C3;
+static const field core::int* binaryOr = #C3;
+static const field core::int* binaryAnd = #C3;
+static const field core::int* binaryXor = #C3;
+static const field core::int* binaryShift1 = #C3;
+static const field core::int* binaryShift4 = #C3;
+static const field core::int* binaryShift5 = #C4;
+static const field core::bool* binaryLess = #C5;
+static const field core::bool* binaryLessEqual = #C6;
+static const field core::bool* binaryGreaterEqual = #C6;
+static const field core::bool* binaryGreater = #C5;
+static const field core::int* doubleTruncateDiv = #C3;
+static const field core::int* doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
+static const field core::double* doubleNan = #C7;
+static const field core::int* doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
+static const field core::int* bigNumber = #C8;
+static method main() → dynamic {}
+
+constants {
+ #C1 = -2.0
+ #C2 = 4294967293.0
+ #C3 = 42.0
+ #C4 = 4294967295.0
+ #C5 = false
+ #C6 = true
+ #C7 = NaN
+ #C8 = 9223372036854776000.0
+}
diff --git a/pkg/front_end/testcases/general/constants/number_folds.dart b/pkg/front_end/testcases/general/constants/number_folds.dart
index a905108..1a45579 100644
--- a/pkg/front_end/testcases/general/constants/number_folds.dart
+++ b/pkg/front_end/testcases/general/constants/number_folds.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// 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.9
+
const int shiftNegative1 = 2 << -1;
const int shiftNegative2 = 2 >>> -1;
const int shiftNegative3 = 2 >> -1;
@@ -23,7 +23,6 @@
const int binaryXor = 63 ^ 21;
const int binaryShift1 = 21 << 1;
-// These aren't currently defined on int :(.
const int binaryShift2 = 84 >>> 1;
const int binaryShift3 = 21 >>> 64;
@@ -35,7 +34,8 @@
const int doubleTruncateDiv = 84.2 ~/ 2;
const int doubleTruncateDivZero = 84.2 ~/ 0;
-const int doubleTruncateDivNull = 84.2 ~/ null;
+const dynamic nil = null;
+const int doubleTruncateDivNull = 84.2 ~/ nil;
const double doubleNan = 0/0;
const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
diff --git a/pkg/front_end/testcases/general/constants/number_folds.dart.textual_outline.expect b/pkg/front_end/testcases/general/constants/number_folds.dart.textual_outline.expect
index 2491b0a..025ab90 100644
--- a/pkg/front_end/testcases/general/constants/number_folds.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/general/constants/number_folds.dart.textual_outline.expect
@@ -1,4 +1,3 @@
-// @dart = 2.9
const int shiftNegative1 = 2 << -1;
const int shiftNegative2 = 2 >>> -1;
const int shiftNegative3 = 2 >> -1;
@@ -27,7 +26,8 @@
const bool binaryGreater = 42 > 42;
const int doubleTruncateDiv = 84.2 ~/ 2;
const int doubleTruncateDivZero = 84.2 ~/ 0;
-const int doubleTruncateDivNull = 84.2 ~/ null;
+const dynamic nil = null;
+const int doubleTruncateDivNull = 84.2 ~/ nil;
const double doubleNan = 0/0;
const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
main() {}
diff --git a/pkg/front_end/testcases/general/constants/number_folds.dart.weak.expect b/pkg/front_end/testcases/general/constants/number_folds.dart.weak.expect
index dc5a80f..6de8923 100644
--- a/pkg/front_end/testcases/general/constants/number_folds.dart.weak.expect
+++ b/pkg/front_end/testcases/general/constants/number_folds.dart.weak.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -61,24 +61,24 @@
// const int intdivZero = 2 ~/ 0;
// ^
//
-// pkg/front_end/testcases/general/constants/number_folds.dart:37:40: Error: Constant evaluation error:
+// pkg/front_end/testcases/general/constants/number_folds.dart:36:40: Error: Constant evaluation error:
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
-// pkg/front_end/testcases/general/constants/number_folds.dart:37:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
+// pkg/front_end/testcases/general/constants/number_folds.dart:36:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
-// pkg/front_end/testcases/general/constants/number_folds.dart:37:11: Context: While analyzing:
+// pkg/front_end/testcases/general/constants/number_folds.dart:36:11: Context: While analyzing:
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
//
// pkg/front_end/testcases/general/constants/number_folds.dart:38:40: Error: Constant evaluation error:
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
// pkg/front_end/testcases/general/constants/number_folds.dart:38:40: Context: Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
// pkg/front_end/testcases/general/constants/number_folds.dart:38:11: Context: While analyzing:
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
//
// pkg/front_end/testcases/general/constants/number_folds.dart:40:39: Error: Constant evaluation error:
@@ -94,41 +94,42 @@
import self as self;
import "dart:core" as core;
-static const field core::int* shiftNegative1 = invalid-expression "Binary operator '<<' on '2' requires non-negative operand, but was '-1'.";
-static const field core::int* shiftNegative2 = invalid-expression "Binary operator '>>>' on '2' requires non-negative operand, but was '-1'.";
-static const field core::int* shiftNegative3 = invalid-expression "Binary operator '>>' on '2' requires non-negative operand, but was '-1'.";
-static const field core::int* modZero = invalid-expression "Binary operator '%' on '2' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* divZero = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+static const field core::int shiftNegative1 = invalid-expression "Binary operator '<<' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int shiftNegative2 = invalid-expression "Binary operator '>>>' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int shiftNegative3 = invalid-expression "Binary operator '>>' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int modZero = invalid-expression "Binary operator '%' on '2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int divZero = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
const int divZero = 2 / 0;
^";
-static const field core::int* intdivZero = invalid-expression "Binary operator '~/' on '2' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* unaryMinus = #C1;
-static const field core::int* unaryTilde = #C2;
-static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:13:23: Error: This couldn't be parsed.
+static const field core::int intdivZero = invalid-expression "Binary operator '~/' on '2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int unaryMinus = #C1;
+static const field core::int unaryTilde = #C2;
+static const field core::int unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:13:23: Error: This couldn't be parsed.
const int unaryPlus = +2;
^";
-static const field core::int* binaryPlus = #C3;
-static const field core::int* binaryMinus = #C3;
-static const field core::int* binaryTimes = #C3;
-static const field core::double* binaryDiv = #C4;
-static const field core::int* binaryTildeDiv = #C3;
-static const field core::int* binaryMod = #C3;
-static const field core::int* binaryOr = #C3;
-static const field core::int* binaryAnd = #C3;
-static const field core::int* binaryXor = #C3;
-static const field core::int* binaryShift1 = #C3;
-static const field core::int* binaryShift2 = #C3;
-static const field core::int* binaryShift3 = #C5;
-static const field core::int* binaryShift4 = #C3;
-static const field core::bool* binaryLess = #C6;
-static const field core::bool* binaryLessEqual = #C7;
-static const field core::bool* binaryGreaterEqual = #C7;
-static const field core::bool* binaryGreater = #C6;
-static const field core::int* doubleTruncateDiv = #C3;
-static const field core::int* doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
-static const field core::double* doubleNan = #C8;
-static const field core::int* doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
+static const field core::int binaryPlus = #C3;
+static const field core::int binaryMinus = #C3;
+static const field core::int binaryTimes = #C3;
+static const field core::double binaryDiv = #C4;
+static const field core::int binaryTildeDiv = #C3;
+static const field core::int binaryMod = #C3;
+static const field core::int binaryOr = #C3;
+static const field core::int binaryAnd = #C3;
+static const field core::int binaryXor = #C3;
+static const field core::int binaryShift1 = #C3;
+static const field core::int binaryShift2 = #C3;
+static const field core::int binaryShift3 = #C5;
+static const field core::int binaryShift4 = #C3;
+static const field core::bool binaryLess = #C6;
+static const field core::bool binaryLessEqual = #C7;
+static const field core::bool binaryGreaterEqual = #C7;
+static const field core::bool binaryGreater = #C6;
+static const field core::int doubleTruncateDiv = #C3;
+static const field core::int doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
+static const field dynamic nil = #C8;
+static const field core::int doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
+static const field core::double doubleNan = #C9;
+static const field core::int doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
static method main() → dynamic {}
constants {
@@ -139,5 +140,6 @@
#C5 = 0
#C6 = false
#C7 = true
- #C8 = NaN
+ #C8 = null
+ #C9 = NaN
}
diff --git a/pkg/front_end/testcases/general/constants/number_folds.dart.weak.outline.expect b/pkg/front_end/testcases/general/constants/number_folds.dart.weak.outline.expect
index 844245f..83af03a 100644
--- a/pkg/front_end/testcases/general/constants/number_folds.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/general/constants/number_folds.dart.weak.outline.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -14,41 +14,42 @@
import self as self;
import "dart:core" as core;
-static const field core::int* shiftNegative1 = 2.{core::int::<<}(1.{core::int::unary-}());
-static const field core::int* shiftNegative2 = 2.{core::int::>>>}(1.{core::int::unary-}());
-static const field core::int* shiftNegative3 = 2.{core::int::>>}(1.{core::int::unary-}());
-static const field core::int* modZero = 2.{core::num::%}(0);
-static const field core::int* divZero = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+static const field core::int shiftNegative1 = 2.{core::int::<<}(1.{core::int::unary-}());
+static const field core::int shiftNegative2 = 2.{core::int::>>>}(1.{core::int::unary-}());
+static const field core::int shiftNegative3 = 2.{core::int::>>}(1.{core::int::unary-}());
+static const field core::int modZero = 2.{core::num::%}(0);
+static const field core::int divZero = let final Never #t1 = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
const int divZero = 2 / 0;
- ^" in 2.{core::num::/}(0) as{TypeError} core::int*;
-static const field core::int* intdivZero = 2.{core::num::~/}(0);
-static const field core::int* unaryMinus = 2.{core::int::unary-}();
-static const field core::int* unaryTilde = 2.{core::int::~}();
-static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:13:23: Error: This couldn't be parsed.
+ ^" in 2.{core::num::/}(0) as{TypeError,ForNonNullableByDefault} core::int;
+static const field core::int intdivZero = 2.{core::num::~/}(0);
+static const field core::int unaryMinus = 2.{core::int::unary-}();
+static const field core::int unaryTilde = 2.{core::int::~}();
+static const field core::int unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:13:23: Error: This couldn't be parsed.
const int unaryPlus = +2;
- ^".+(2) as{TypeError,ForDynamic} core::int*;
-static const field core::int* binaryPlus = 40.{core::num::+}(2);
-static const field core::int* binaryMinus = 44.{core::num::-}(2);
-static const field core::int* binaryTimes = 21.{core::num::*}(2);
-static const field core::double* binaryDiv = 84.{core::num::/}(2);
-static const field core::int* binaryTildeDiv = 84.{core::num::~/}(2);
-static const field core::int* binaryMod = 85.{core::num::%}(43);
-static const field core::int* binaryOr = 32.{core::int::|}(10);
-static const field core::int* binaryAnd = 63.{core::int::&}(106);
-static const field core::int* binaryXor = 63.{core::int::^}(21);
-static const field core::int* binaryShift1 = 21.{core::int::<<}(1);
-static const field core::int* binaryShift2 = 84.{core::int::>>>}(1);
-static const field core::int* binaryShift3 = 21.{core::int::>>>}(64);
-static const field core::int* binaryShift4 = 84.{core::int::>>}(1);
-static const field core::bool* binaryLess = 42.{core::num::<}(42);
-static const field core::bool* binaryLessEqual = 42.{core::num::<=}(42);
-static const field core::bool* binaryGreaterEqual = 42.{core::num::>=}(42);
-static const field core::bool* binaryGreater = 42.{core::num::>}(42);
-static const field core::int* doubleTruncateDiv = 84.2.{core::double::~/}(2);
-static const field core::int* doubleTruncateDivZero = 84.2.{core::double::~/}(0);
-static const field core::int* doubleTruncateDivNull = 84.2.{core::double::~/}(null);
-static const field core::double* doubleNan = 0.{core::num::/}(0);
-static const field core::int* doubleTruncateDivNaN = 84.2.{core::double::~/}(self::doubleNan);
+ ^".+(2) as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
+static const field core::int binaryPlus = 40.{core::num::+}(2);
+static const field core::int binaryMinus = 44.{core::num::-}(2);
+static const field core::int binaryTimes = 21.{core::num::*}(2);
+static const field core::double binaryDiv = 84.{core::num::/}(2);
+static const field core::int binaryTildeDiv = 84.{core::num::~/}(2);
+static const field core::int binaryMod = 85.{core::num::%}(43);
+static const field core::int binaryOr = 32.{core::int::|}(10);
+static const field core::int binaryAnd = 63.{core::int::&}(106);
+static const field core::int binaryXor = 63.{core::int::^}(21);
+static const field core::int binaryShift1 = 21.{core::int::<<}(1);
+static const field core::int binaryShift2 = 84.{core::int::>>>}(1);
+static const field core::int binaryShift3 = 21.{core::int::>>>}(64);
+static const field core::int binaryShift4 = 84.{core::int::>>}(1);
+static const field core::bool binaryLess = 42.{core::num::<}(42);
+static const field core::bool binaryLessEqual = 42.{core::num::<=}(42);
+static const field core::bool binaryGreaterEqual = 42.{core::num::>=}(42);
+static const field core::bool binaryGreater = 42.{core::num::>}(42);
+static const field core::int doubleTruncateDiv = 84.2.{core::double::~/}(2);
+static const field core::int doubleTruncateDivZero = 84.2.{core::double::~/}(0);
+static const field dynamic nil = null;
+static const field core::int doubleTruncateDivNull = 84.2.{core::double::~/}(self::nil as{TypeError,ForDynamic,ForNonNullableByDefault} core::num);
+static const field core::double doubleNan = 0.{core::num::/}(0);
+static const field core::int doubleTruncateDivNaN = 84.2.{core::double::~/}(self::doubleNan);
static method main() → dynamic
;
@@ -70,14 +71,15 @@
Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:22:26 -> IntConstant(42)
Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:23:26 -> IntConstant(42)
Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:24:29 -> IntConstant(42)
-Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:27:29 -> IntConstant(42)
-Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:28:29 -> IntConstant(0)
-Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:30:29 -> IntConstant(42)
-Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:31:28 -> BoolConstant(false)
-Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:32:33 -> BoolConstant(true)
-Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:33:36 -> BoolConstant(true)
-Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:34:31 -> BoolConstant(false)
-Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:36:36 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:26:29 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:27:29 -> IntConstant(0)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:29:29 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:30:28 -> BoolConstant(false)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:31:33 -> BoolConstant(true)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:32:36 -> BoolConstant(true)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:33:31 -> BoolConstant(false)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:35:36 -> IntConstant(42)
+Evaluated: AsExpression @ org-dartlang-testcase:///number_folds.dart:38:43 -> NullConstant(null)
Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds.dart:39:27 -> DoubleConstant(NaN)
Evaluated: StaticGet @ org-dartlang-testcase:///number_folds.dart:40:42 -> DoubleConstant(NaN)
-Extra constant evaluation: evaluated: 38, effectively constant: 26
+Extra constant evaluation: evaluated: 39, effectively constant: 27
diff --git a/pkg/front_end/testcases/general/constants/number_folds.dart.weak.transformed.expect b/pkg/front_end/testcases/general/constants/number_folds.dart.weak.transformed.expect
index dc5a80f..6de8923 100644
--- a/pkg/front_end/testcases/general/constants/number_folds.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general/constants/number_folds.dart.weak.transformed.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -61,24 +61,24 @@
// const int intdivZero = 2 ~/ 0;
// ^
//
-// pkg/front_end/testcases/general/constants/number_folds.dart:37:40: Error: Constant evaluation error:
+// pkg/front_end/testcases/general/constants/number_folds.dart:36:40: Error: Constant evaluation error:
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
-// pkg/front_end/testcases/general/constants/number_folds.dart:37:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
+// pkg/front_end/testcases/general/constants/number_folds.dart:36:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
-// pkg/front_end/testcases/general/constants/number_folds.dart:37:11: Context: While analyzing:
+// pkg/front_end/testcases/general/constants/number_folds.dart:36:11: Context: While analyzing:
// const int doubleTruncateDivZero = 84.2 ~/ 0;
// ^
//
// pkg/front_end/testcases/general/constants/number_folds.dart:38:40: Error: Constant evaluation error:
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
// pkg/front_end/testcases/general/constants/number_folds.dart:38:40: Context: Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
// pkg/front_end/testcases/general/constants/number_folds.dart:38:11: Context: While analyzing:
-// const int doubleTruncateDivNull = 84.2 ~/ null;
+// const int doubleTruncateDivNull = 84.2 ~/ nil;
// ^
//
// pkg/front_end/testcases/general/constants/number_folds.dart:40:39: Error: Constant evaluation error:
@@ -94,41 +94,42 @@
import self as self;
import "dart:core" as core;
-static const field core::int* shiftNegative1 = invalid-expression "Binary operator '<<' on '2' requires non-negative operand, but was '-1'.";
-static const field core::int* shiftNegative2 = invalid-expression "Binary operator '>>>' on '2' requires non-negative operand, but was '-1'.";
-static const field core::int* shiftNegative3 = invalid-expression "Binary operator '>>' on '2' requires non-negative operand, but was '-1'.";
-static const field core::int* modZero = invalid-expression "Binary operator '%' on '2' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* divZero = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+static const field core::int shiftNegative1 = invalid-expression "Binary operator '<<' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int shiftNegative2 = invalid-expression "Binary operator '>>>' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int shiftNegative3 = invalid-expression "Binary operator '>>' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int modZero = invalid-expression "Binary operator '%' on '2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int divZero = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:9:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
const int divZero = 2 / 0;
^";
-static const field core::int* intdivZero = invalid-expression "Binary operator '~/' on '2' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* unaryMinus = #C1;
-static const field core::int* unaryTilde = #C2;
-static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:13:23: Error: This couldn't be parsed.
+static const field core::int intdivZero = invalid-expression "Binary operator '~/' on '2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int unaryMinus = #C1;
+static const field core::int unaryTilde = #C2;
+static const field core::int unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds.dart:13:23: Error: This couldn't be parsed.
const int unaryPlus = +2;
^";
-static const field core::int* binaryPlus = #C3;
-static const field core::int* binaryMinus = #C3;
-static const field core::int* binaryTimes = #C3;
-static const field core::double* binaryDiv = #C4;
-static const field core::int* binaryTildeDiv = #C3;
-static const field core::int* binaryMod = #C3;
-static const field core::int* binaryOr = #C3;
-static const field core::int* binaryAnd = #C3;
-static const field core::int* binaryXor = #C3;
-static const field core::int* binaryShift1 = #C3;
-static const field core::int* binaryShift2 = #C3;
-static const field core::int* binaryShift3 = #C5;
-static const field core::int* binaryShift4 = #C3;
-static const field core::bool* binaryLess = #C6;
-static const field core::bool* binaryLessEqual = #C7;
-static const field core::bool* binaryGreaterEqual = #C7;
-static const field core::bool* binaryGreater = #C6;
-static const field core::int* doubleTruncateDiv = #C3;
-static const field core::int* doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
-static const field core::int* doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
-static const field core::double* doubleNan = #C8;
-static const field core::int* doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
+static const field core::int binaryPlus = #C3;
+static const field core::int binaryMinus = #C3;
+static const field core::int binaryTimes = #C3;
+static const field core::double binaryDiv = #C4;
+static const field core::int binaryTildeDiv = #C3;
+static const field core::int binaryMod = #C3;
+static const field core::int binaryOr = #C3;
+static const field core::int binaryAnd = #C3;
+static const field core::int binaryXor = #C3;
+static const field core::int binaryShift1 = #C3;
+static const field core::int binaryShift2 = #C3;
+static const field core::int binaryShift3 = #C5;
+static const field core::int binaryShift4 = #C3;
+static const field core::bool binaryLess = #C6;
+static const field core::bool binaryLessEqual = #C7;
+static const field core::bool binaryGreaterEqual = #C7;
+static const field core::bool binaryGreater = #C6;
+static const field core::int doubleTruncateDiv = #C3;
+static const field core::int doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
+static const field dynamic nil = #C8;
+static const field core::int doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
+static const field core::double doubleNan = #C9;
+static const field core::int doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
static method main() → dynamic {}
constants {
@@ -139,5 +140,6 @@
#C5 = 0
#C6 = false
#C7 = true
- #C8 = NaN
+ #C8 = null
+ #C9 = NaN
}
diff --git a/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart
new file mode 100644
index 0000000..0ad98da
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.9
+
+const int shiftNegative1 = 2 << -1;
+const int shiftNegative3 = 2 >> -1;
+const int modZero = 2 % 0;
+const int divZero = 2 / 0;
+const int intdivZero = 2 ~/ 0;
+const int unaryMinus = -2;
+const int unaryTilde = ~2;
+const int unaryPlus = +2;
+
+const int binaryPlus = 40 + 2;
+const int binaryMinus = 44 - 2;
+const int binaryTimes = 21 * 2;
+const double binaryDiv = 84 / 2;
+const int binaryTildeDiv = 84~/ 2;
+const int binaryMod = 85 % 43;
+const int binaryOr = 32 | 10;
+const int binaryAnd = 63 & 106;
+const int binaryXor = 63 ^ 21;
+const int binaryShift1 = 21 << 1;
+
+const int binaryShift4 = 84 >> 1;
+const bool binaryLess = 42 < 42;
+const bool binaryLessEqual = 42 <= 42;
+const bool binaryGreaterEqual = 42 >= 42;
+const bool binaryGreater = 42 > 42;
+
+const int doubleTruncateDiv = 84.2 ~/ 2;
+const int doubleTruncateDivZero = 84.2 ~/ 0;
+const int doubleTruncateDivNull = 84.2 ~/ null;
+const double doubleNan = 0/0;
+const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+
+main() {
+
+}
\ No newline at end of file
diff --git a/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.textual_outline.expect b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.textual_outline.expect
new file mode 100644
index 0000000..128603c
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.textual_outline.expect
@@ -0,0 +1,30 @@
+// @dart = 2.9
+const int shiftNegative1 = 2 << -1;
+const int shiftNegative3 = 2 >> -1;
+const int modZero = 2 % 0;
+const int divZero = 2 / 0;
+const int intdivZero = 2 ~/ 0;
+const int unaryMinus = -2;
+const int unaryTilde = ~2;
+const int unaryPlus = +2;
+const int binaryPlus = 40 + 2;
+const int binaryMinus = 44 - 2;
+const int binaryTimes = 21 * 2;
+const double binaryDiv = 84 / 2;
+const int binaryTildeDiv = 84~/ 2;
+const int binaryMod = 85 % 43;
+const int binaryOr = 32 | 10;
+const int binaryAnd = 63 & 106;
+const int binaryXor = 63 ^ 21;
+const int binaryShift1 = 21 << 1;
+const int binaryShift4 = 84 >> 1;
+const bool binaryLess = 42 < 42;
+const bool binaryLessEqual = 42 <= 42;
+const bool binaryGreaterEqual = 42 >= 42;
+const bool binaryGreater = 42 > 42;
+const int doubleTruncateDiv = 84.2 ~/ 2;
+const int doubleTruncateDivZero = 84.2 ~/ 0;
+const int doubleTruncateDivNull = 84.2 ~/ null;
+const double doubleNan = 0/0;
+const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+main() {}
diff --git a/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.expect b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.expect
new file mode 100644
index 0000000..44bc90e
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.expect
@@ -0,0 +1,129 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:14:23: Error: '+' is not a prefix operator.
+// Try removing '+'.
+// const int unaryPlus = +2;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+// const int divZero = 2 / 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:7:30: Error: Constant evaluation error:
+// const int shiftNegative1 = 2 << -1;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:7:30: Context: Binary operator '<<' on '2' requires non-negative operand, but was '-1'.
+// const int shiftNegative1 = 2 << -1;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:7:11: Context: While analyzing:
+// const int shiftNegative1 = 2 << -1;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:8:30: Error: Constant evaluation error:
+// const int shiftNegative3 = 2 >> -1;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:8:30: Context: Binary operator '>>' on '2' requires non-negative operand, but was '-1'.
+// const int shiftNegative3 = 2 >> -1;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:8:11: Context: While analyzing:
+// const int shiftNegative3 = 2 >> -1;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:9:23: Error: Constant evaluation error:
+// const int modZero = 2 % 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:9:23: Context: Binary operator '%' on '2' requires non-zero divisor, but divisor was '0'.
+// const int modZero = 2 % 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:9:11: Context: While analyzing:
+// const int modZero = 2 % 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:11:26: Error: Constant evaluation error:
+// const int intdivZero = 2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:11:26: Context: Binary operator '~/' on '2' requires non-zero divisor, but divisor was '0'.
+// const int intdivZero = 2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:11:11: Context: While analyzing:
+// const int intdivZero = 2 ~/ 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:34:40: Error: Constant evaluation error:
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:34:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:34:11: Context: While analyzing:
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:35:40: Error: Constant evaluation error:
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:35:40: Context: Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:35:11: Context: While analyzing:
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:37:39: Error: Constant evaluation error:
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:37:39: Context: Binary operator '84.2 ~/ NaN' results is Infinity or NaN.
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:37:11: Context: While analyzing:
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+static const field core::int* shiftNegative1 = invalid-expression "Binary operator '<<' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int* shiftNegative3 = invalid-expression "Binary operator '>>' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int* modZero = invalid-expression "Binary operator '%' on '2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* divZero = invalid-expression "pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+const int divZero = 2 / 0;
+ ^";
+static const field core::int* intdivZero = invalid-expression "Binary operator '~/' on '2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* unaryMinus = #C1;
+static const field core::int* unaryTilde = #C2;
+static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:14:23: Error: This couldn't be parsed.
+const int unaryPlus = +2;
+ ^";
+static const field core::int* binaryPlus = #C3;
+static const field core::int* binaryMinus = #C3;
+static const field core::int* binaryTimes = #C3;
+static const field core::double* binaryDiv = #C4;
+static const field core::int* binaryTildeDiv = #C3;
+static const field core::int* binaryMod = #C3;
+static const field core::int* binaryOr = #C3;
+static const field core::int* binaryAnd = #C3;
+static const field core::int* binaryXor = #C3;
+static const field core::int* binaryShift1 = #C3;
+static const field core::int* binaryShift4 = #C3;
+static const field core::bool* binaryLess = #C5;
+static const field core::bool* binaryLessEqual = #C6;
+static const field core::bool* binaryGreaterEqual = #C6;
+static const field core::bool* binaryGreater = #C5;
+static const field core::int* doubleTruncateDiv = #C3;
+static const field core::int* doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
+static const field core::double* doubleNan = #C7;
+static const field core::int* doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
+static method main() → dynamic {}
+
+constants {
+ #C1 = -2
+ #C2 = -3
+ #C3 = 42
+ #C4 = 42.0
+ #C5 = false
+ #C6 = true
+ #C7 = NaN
+}
diff --git a/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.outline.expect b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.outline.expect
new file mode 100644
index 0000000..df84569
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.outline.expect
@@ -0,0 +1,77 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:14:23: Error: '+' is not a prefix operator.
+// Try removing '+'.
+// const int unaryPlus = +2;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+// const int divZero = 2 / 0;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+static const field core::int* shiftNegative1 = 2.{core::int::<<}(1.{core::int::unary-}());
+static const field core::int* shiftNegative3 = 2.{core::int::>>}(1.{core::int::unary-}());
+static const field core::int* modZero = 2.{core::num::%}(0);
+static const field core::int* divZero = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+const int divZero = 2 / 0;
+ ^" in 2.{core::num::/}(0) as{TypeError} core::int*;
+static const field core::int* intdivZero = 2.{core::num::~/}(0);
+static const field core::int* unaryMinus = 2.{core::int::unary-}();
+static const field core::int* unaryTilde = 2.{core::int::~}();
+static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:14:23: Error: This couldn't be parsed.
+const int unaryPlus = +2;
+ ^".+(2) as{TypeError,ForDynamic} core::int*;
+static const field core::int* binaryPlus = 40.{core::num::+}(2);
+static const field core::int* binaryMinus = 44.{core::num::-}(2);
+static const field core::int* binaryTimes = 21.{core::num::*}(2);
+static const field core::double* binaryDiv = 84.{core::num::/}(2);
+static const field core::int* binaryTildeDiv = 84.{core::num::~/}(2);
+static const field core::int* binaryMod = 85.{core::num::%}(43);
+static const field core::int* binaryOr = 32.{core::int::|}(10);
+static const field core::int* binaryAnd = 63.{core::int::&}(106);
+static const field core::int* binaryXor = 63.{core::int::^}(21);
+static const field core::int* binaryShift1 = 21.{core::int::<<}(1);
+static const field core::int* binaryShift4 = 84.{core::int::>>}(1);
+static const field core::bool* binaryLess = 42.{core::num::<}(42);
+static const field core::bool* binaryLessEqual = 42.{core::num::<=}(42);
+static const field core::bool* binaryGreaterEqual = 42.{core::num::>=}(42);
+static const field core::bool* binaryGreater = 42.{core::num::>}(42);
+static const field core::int* doubleTruncateDiv = 84.2.{core::double::~/}(2);
+static const field core::int* doubleTruncateDivZero = 84.2.{core::double::~/}(0);
+static const field core::int* doubleTruncateDivNull = 84.2.{core::double::~/}(null);
+static const field core::double* doubleNan = 0.{core::num::/}(0);
+static const field core::int* doubleTruncateDivNaN = 84.2.{core::double::~/}(self::doubleNan);
+static method main() → dynamic
+ ;
+
+
+Extra constant evaluation status:
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:7:33 -> IntConstant(-1)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:8:33 -> IntConstant(-1)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:10:23 -> DoubleConstant(Infinity)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:12:24 -> IntConstant(-2)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:13:24 -> IntConstant(-3)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:16:27 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:17:28 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:18:28 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:19:29 -> DoubleConstant(42.0)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:20:30 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:21:26 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:22:25 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:23:26 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:24:26 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:25:29 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:27:29 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:28:28 -> BoolConstant(false)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:29:33 -> BoolConstant(true)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:30:36 -> BoolConstant(true)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:31:31 -> BoolConstant(false)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:33:36 -> IntConstant(42)
+Evaluated: MethodInvocation @ org-dartlang-testcase:///number_folds_opt_out.dart:36:27 -> DoubleConstant(NaN)
+Evaluated: StaticGet @ org-dartlang-testcase:///number_folds_opt_out.dart:37:42 -> DoubleConstant(NaN)
+Extra constant evaluation: evaluated: 34, effectively constant: 23
diff --git a/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.transformed.expect b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.transformed.expect
new file mode 100644
index 0000000..44bc90e
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/number_folds_opt_out.dart.weak.transformed.expect
@@ -0,0 +1,129 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:14:23: Error: '+' is not a prefix operator.
+// Try removing '+'.
+// const int unaryPlus = +2;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+// const int divZero = 2 / 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:7:30: Error: Constant evaluation error:
+// const int shiftNegative1 = 2 << -1;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:7:30: Context: Binary operator '<<' on '2' requires non-negative operand, but was '-1'.
+// const int shiftNegative1 = 2 << -1;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:7:11: Context: While analyzing:
+// const int shiftNegative1 = 2 << -1;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:8:30: Error: Constant evaluation error:
+// const int shiftNegative3 = 2 >> -1;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:8:30: Context: Binary operator '>>' on '2' requires non-negative operand, but was '-1'.
+// const int shiftNegative3 = 2 >> -1;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:8:11: Context: While analyzing:
+// const int shiftNegative3 = 2 >> -1;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:9:23: Error: Constant evaluation error:
+// const int modZero = 2 % 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:9:23: Context: Binary operator '%' on '2' requires non-zero divisor, but divisor was '0'.
+// const int modZero = 2 % 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:9:11: Context: While analyzing:
+// const int modZero = 2 % 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:11:26: Error: Constant evaluation error:
+// const int intdivZero = 2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:11:26: Context: Binary operator '~/' on '2' requires non-zero divisor, but divisor was '0'.
+// const int intdivZero = 2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:11:11: Context: While analyzing:
+// const int intdivZero = 2 ~/ 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:34:40: Error: Constant evaluation error:
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:34:40: Context: Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:34:11: Context: While analyzing:
+// const int doubleTruncateDivZero = 84.2 ~/ 0;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:35:40: Error: Constant evaluation error:
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:35:40: Context: Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:35:11: Context: While analyzing:
+// const int doubleTruncateDivNull = 84.2 ~/ null;
+// ^
+//
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:37:39: Error: Constant evaluation error:
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:37:39: Context: Binary operator '84.2 ~/ NaN' results is Infinity or NaN.
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+// pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:37:11: Context: While analyzing:
+// const int doubleTruncateDivNaN = 84.2 ~/ doubleNan;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+static const field core::int* shiftNegative1 = invalid-expression "Binary operator '<<' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int* shiftNegative3 = invalid-expression "Binary operator '>>' on '2' requires non-negative operand, but was '-1'.";
+static const field core::int* modZero = invalid-expression "Binary operator '%' on '2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* divZero = invalid-expression "pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:10:23: Error: A value of type 'double' can't be assigned to a variable of type 'int'.
+const int divZero = 2 / 0;
+ ^";
+static const field core::int* intdivZero = invalid-expression "Binary operator '~/' on '2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* unaryMinus = #C1;
+static const field core::int* unaryTilde = #C2;
+static const field core::int* unaryPlus = invalid-expression "pkg/front_end/testcases/general/constants/number_folds_opt_out.dart:14:23: Error: This couldn't be parsed.
+const int unaryPlus = +2;
+ ^";
+static const field core::int* binaryPlus = #C3;
+static const field core::int* binaryMinus = #C3;
+static const field core::int* binaryTimes = #C3;
+static const field core::double* binaryDiv = #C4;
+static const field core::int* binaryTildeDiv = #C3;
+static const field core::int* binaryMod = #C3;
+static const field core::int* binaryOr = #C3;
+static const field core::int* binaryAnd = #C3;
+static const field core::int* binaryXor = #C3;
+static const field core::int* binaryShift1 = #C3;
+static const field core::int* binaryShift4 = #C3;
+static const field core::bool* binaryLess = #C5;
+static const field core::bool* binaryLessEqual = #C6;
+static const field core::bool* binaryGreaterEqual = #C6;
+static const field core::bool* binaryGreater = #C5;
+static const field core::int* doubleTruncateDiv = #C3;
+static const field core::int* doubleTruncateDivZero = invalid-expression "Binary operator '~/' on '84.2' requires non-zero divisor, but divisor was '0'.";
+static const field core::int* doubleTruncateDivNull = invalid-expression "Binary operator '~/' on '84.2' requires operand of type 'num', but was of type 'Null'.";
+static const field core::double* doubleNan = #C7;
+static const field core::int* doubleTruncateDivNaN = invalid-expression "Binary operator '84.2 ~/ NaN' results is Infinity or NaN.";
+static method main() → dynamic {}
+
+constants {
+ #C1 = -2
+ #C2 = -3
+ #C3 = 42
+ #C4 = 42.0
+ #C5 = false
+ #C6 = true
+ #C7 = NaN
+}
diff --git a/pkg/front_end/testcases/general/function_invocation_bounds.dart b/pkg/front_end/testcases/general/function_invocation_bounds.dart
new file mode 100644
index 0000000..5e01a3a
--- /dev/null
+++ b/pkg/front_end/testcases/general/function_invocation_bounds.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+typedef T G<T>(T t);
+
+test() {
+ T local<T extends num>(T t) => t;
+ local("");
+ local<String>(throw '');
+ local(0);
+ local<int>(throw '');
+ local<int, String>(throw '');
+ var f = local;
+ f("");
+ f<String>(throw '');
+ f(0);
+ f<int>(throw '');
+ f<int, String>(throw '');
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/general/function_invocation_bounds.dart.textual_outline.expect b/pkg/front_end/testcases/general/function_invocation_bounds.dart.textual_outline.expect
new file mode 100644
index 0000000..4eb293e
--- /dev/null
+++ b/pkg/front_end/testcases/general/function_invocation_bounds.dart.textual_outline.expect
@@ -0,0 +1,3 @@
+typedef T G<T>(T t);
+test() {}
+main() {}
diff --git a/pkg/front_end/testcases/general/function_invocation_bounds.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/function_invocation_bounds.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..6ff567c
--- /dev/null
+++ b/pkg/front_end/testcases/general/function_invocation_bounds.dart.textual_outline_modelled.expect
@@ -0,0 +1,3 @@
+main() {}
+test() {}
+typedef T G<T>(T t);
diff --git a/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.expect b/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.expect
new file mode 100644
index 0000000..ea6f457
--- /dev/null
+++ b/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.expect
@@ -0,0 +1,56 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:9:8: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'local'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local("");
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:10:8: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'local'.
+// Try changing type arguments so that they conform to the bounds.
+// local<String>(throw '');
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:13:8: Error: Expected 1 type arguments.
+// local<int, String>(throw '');
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:15:4: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'call'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f("");
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:16:4: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'call'.
+// Try changing type arguments so that they conform to the bounds.
+// f<String>(throw '');
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:19:4: Error: Expected 1 type arguments.
+// f<int, String>(throw '');
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef G<invariant T extends core::Object? = dynamic> = (T%) → T%;
+static method test() → dynamic {
+ function local<T extends core::num = core::num>(T t) → T
+ return t;
+ local.call<core::String>("");
+ local.call<core::String>(throw "");
+ local.call<core::int>(0);
+ local.call<core::int>(throw "");
+ let final Never #t1 = invalid-expression "pkg/front_end/testcases/general/function_invocation_bounds.dart:13:8: Error: Expected 1 type arguments.
+ local<int, String>(throw '');
+ ^" in local.call<core::int, core::String>(throw "");
+ <T extends core::num = core::num>(T) → T f = local;
+ f.call<core::String>("");
+ f.call<core::String>(throw "");
+ f.call<core::int>(0);
+ f.call<core::int>(throw "");
+ let final Never #t2 = invalid-expression "pkg/front_end/testcases/general/function_invocation_bounds.dart:19:4: Error: Expected 1 type arguments.
+ f<int, String>(throw '');
+ ^" in f.call<core::int, core::String>(throw "");
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.outline.expect b/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.outline.expect
new file mode 100644
index 0000000..b663e0a
--- /dev/null
+++ b/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.outline.expect
@@ -0,0 +1,9 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+typedef G<invariant T extends core::Object? = dynamic> = (T%) → T%;
+static method test() → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.transformed.expect b/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.transformed.expect
new file mode 100644
index 0000000..f71e3b1
--- /dev/null
+++ b/pkg/front_end/testcases/general/function_invocation_bounds.dart.weak.transformed.expect
@@ -0,0 +1,51 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:18:3: Error: 'F' isn't a type.
+// F g = local;
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:9:8: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'local'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local("");
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:10:8: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'local'.
+// Try changing type arguments so that they conform to the bounds.
+// local<String>(throw '');
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:14:4: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'call'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f("");
+// ^
+//
+// pkg/front_end/testcases/general/function_invocation_bounds.dart:15:4: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'call'.
+// Try changing type arguments so that they conform to the bounds.
+// f<String>(throw '');
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef G<invariant T extends core::Object? = dynamic> = (T%) → T%;
+static method test() → dynamic {
+ function local<T extends core::num = core::num>(T t) → T
+ return t;
+ local.call<core::String>("");
+ local.call<core::String>(throw "");
+ local.call<core::int>(0);
+ local.call<core::int>(throw "");
+ <T extends core::num = core::num>(T) → T f = local;
+ f.call<core::String>("");
+ f.call<core::String>(throw "");
+ f.call<core::int>(0);
+ f.call<core::int>(throw "");
+ invalid-type g = local;
+ g.call("");
+ g.call<core::String>(throw "");
+ g.call(0);
+ g.call<core::int>(throw "");
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general/nsm_covariance.dart b/pkg/front_end/testcases/general/nsm_covariance.dart
index d579d47..15b27f7 100644
--- a/pkg/front_end/testcases/general/nsm_covariance.dart
+++ b/pkg/front_end/testcases/general/nsm_covariance.dart
@@ -1,7 +1,9 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// 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.9
+
import 'nsm_covariance_lib.dart';
abstract class D1 implements A<int>, B {}
diff --git a/pkg/front_end/testcases/general/nsm_covariance.dart.weak.outline.expect b/pkg/front_end/testcases/general/nsm_covariance.dart.weak.outline.expect
index b434cfe..0376936 100644
--- a/pkg/front_end/testcases/general/nsm_covariance.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/general/nsm_covariance.dart.weak.outline.expect
@@ -219,44 +219,44 @@
Extra constant evaluation status:
-Evaluated: StaticGet @ org-dartlang-testcase:///nsm_covariance.dart:12:4 -> InstanceConstant(const _Override{})
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#_method1)
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> ListConstant(const <Type*>[])
-Evaluated: MapLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#_method2)
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> ListConstant(const <Type*>[])
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> ListConstant(const <dynamic>[])
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#a)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#b)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#c)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#d)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#_method3)
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> ListConstant(const <Type*>[])
-Evaluated: MapLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#_method4)
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> ListConstant(const <Type*>[])
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> ListConstant(const <dynamic>[])
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#a)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:11:7 -> SymbolConstant(#b)
-Evaluated: StaticGet @ org-dartlang-testcase:///nsm_covariance.dart:17:4 -> InstanceConstant(const _Override{})
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#_method1)
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> ListConstant(const <Type*>[])
-Evaluated: MapLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#_method2)
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> ListConstant(const <Type*>[])
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> ListConstant(const <dynamic>[])
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#a)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#b)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#c)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#d)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#_method3)
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> ListConstant(const <Type*>[])
-Evaluated: MapLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#_method4)
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> ListConstant(const <Type*>[])
-Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> ListConstant(const <dynamic>[])
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#a)
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:16:7 -> SymbolConstant(#b)
+Evaluated: StaticGet @ org-dartlang-testcase:///nsm_covariance.dart:14:4 -> InstanceConstant(const _Override{})
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#_method1)
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> ListConstant(const <Type*>[])
+Evaluated: MapLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#_method2)
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> ListConstant(const <Type*>[])
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> ListConstant(const <dynamic>[])
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#a)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#b)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#c)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#d)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#_method3)
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> ListConstant(const <Type*>[])
+Evaluated: MapLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#_method4)
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> ListConstant(const <Type*>[])
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> ListConstant(const <dynamic>[])
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#a)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:13:7 -> SymbolConstant(#b)
+Evaluated: StaticGet @ org-dartlang-testcase:///nsm_covariance.dart:19:4 -> InstanceConstant(const _Override{})
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#_method1)
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> ListConstant(const <Type*>[])
+Evaluated: MapLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#_method2)
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> ListConstant(const <Type*>[])
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> ListConstant(const <dynamic>[])
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#a)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#b)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#c)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#d)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#_method3)
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> ListConstant(const <Type*>[])
+Evaluated: MapLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#_method4)
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> ListConstant(const <Type*>[])
+Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> ListConstant(const <dynamic>[])
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#a)
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance.dart:18:7 -> SymbolConstant(#b)
Evaluated: StaticGet @ org-dartlang-testcase:///nsm_covariance_lib.dart:24:4 -> InstanceConstant(const _Override{})
Evaluated: SymbolLiteral @ org-dartlang-testcase:///nsm_covariance_lib.dart:23:7 -> SymbolConstant(#_method1)
Evaluated: ListLiteral @ org-dartlang-testcase:///nsm_covariance_lib.dart:23:7 -> ListConstant(const <Type*>[])
diff --git a/pkg/front_end/testcases/incremental/remove_language_version.yaml b/pkg/front_end/testcases/incremental/remove_language_version.yaml
new file mode 100644
index 0000000..fc000e4
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/remove_language_version.yaml
@@ -0,0 +1,34 @@
+# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE.md file.
+
+# Compile a library with an explicit language version that prohibits use of
+# null safety syntax. Remove the explicit language version annotation in
+# the update to check the version isn't copied over from the original
+# library.
+
+type: newworld
+worlds:
+ - entry: main.dart
+ experiments: non-nullable
+ errors: true
+ warnings: false
+ sources:
+ main.dart: |
+ // @dart=2.9
+ main() {
+ int? i;
+ }
+ expectedLibraryCount: 1
+ - entry: main.dart
+ experiments: non-nullable
+ invalidate:
+ - main.dart
+ errors: false
+ warnings: false
+ sources:
+ main.dart: |
+ main() {
+ int? i;
+ }
+ expectedLibraryCount: 1
\ No newline at end of file
diff --git a/pkg/front_end/testcases/incremental/remove_language_version.yaml.world.1.expect b/pkg/front_end/testcases/incremental/remove_language_version.yaml.world.1.expect
new file mode 100644
index 0000000..033ad48
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/remove_language_version.yaml.world.1.expect
@@ -0,0 +1,18 @@
+main = main::main;
+library from "org-dartlang-test:///main.dart" as main {
+//
+// Problems in library:
+//
+// org-dartlang-test:///main.dart:3:6: Error: Null safety features are disabled for this library.
+// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
+// int? i;
+// ^
+// org-dartlang-test:///main.dart:1:1: Context: This is the annotation that opts out this library from null safety features.
+// // @dart=2.9
+// ^^^^^^^^^^^^
+//
+
+ static method main() → dynamic {
+ dart.core::int? i;
+ }
+}
diff --git a/pkg/front_end/testcases/incremental/remove_language_version.yaml.world.2.expect b/pkg/front_end/testcases/incremental/remove_language_version.yaml.world.2.expect
new file mode 100644
index 0000000..c699ac4
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/remove_language_version.yaml.world.2.expect
@@ -0,0 +1,7 @@
+main = main::main;
+library from "org-dartlang-test:///main.dart" as main {
+
+ static method main() → dynamic {
+ dart.core::int? i;
+ }
+}
diff --git a/pkg/front_end/testcases/nnbd/assignability.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/assignability.dart.strong.transformed.expect
index 35a2bad..1511c7e 100644
--- a/pkg/front_end/testcases/nnbd/assignability.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/assignability.dart.strong.transformed.expect
@@ -1324,466 +1324,466 @@
functionVar = let final Never #t104 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:200:17: Error: A value of type 'Function?' can't be assigned to a variable of type 'Function' because 'Function?' is nullable and 'Function' isn't.
- 'Function' is from 'dart:core'.
functionVar = functionNullableArg;
- ^" in let core::Function? #t105 = functionNullableArg in #t105.==(null) ?{core::Function} #t105 as{TypeError,ForNonNullableByDefault} core::Function : #t105{core::Function};
- functionVar = let final Never #t106 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:201:17: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'Function' because 'void Function()?' is nullable and 'Function' isn't.
+ ^" in functionNullableArg as{TypeError,ForNonNullableByDefault} core::Function;
+ functionVar = let final Never #t105 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:201:17: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'Function' because 'void Function()?' is nullable and 'Function' isn't.
- 'Function' is from 'dart:core'.
functionVar = toVoidNullableArg;
- ^" in let () →? void #t107 = toVoidNullableArg in #t107.==(null) ?{core::Function} #t107 as{TypeError,ForNonNullableByDefault} core::Function : #t107{core::Function};
- functionVar = let final Never #t108 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:202:17: Error: Can't tear off method 'call' from a potentially null value.
+ ^" in toVoidNullableArg as{TypeError,ForNonNullableByDefault} core::Function;
+ functionVar = let final Never #t106 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:202:17: Error: Can't tear off method 'call' from a potentially null value.
functionVar = tearoffableNullableArg;
^" in tearoffableNullableArg as{TypeError} core::Function;
- functionVar = let final Never #t109 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:203:17: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'Function'.
+ functionVar = let final Never #t107 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:203:17: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'Function'.
- 'Function' is from 'dart:core'.
functionVar = xNonNullArg;
^" in xNonNullArg as{TypeError,ForNonNullableByDefault} core::Function;
- functionVar = let final Never #t110 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:204:17: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'Function'.
+ functionVar = let final Never #t108 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:204:17: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'Function'.
- 'Function' is from 'dart:core'.
functionVar = xNonNullNullableArg;
^" in xNonNullNullableArg as{TypeError,ForNonNullableByDefault} core::Function;
- functionVar = let final Never #t111 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:205:17: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'Function'.
+ functionVar = let final Never #t109 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:205:17: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'Function'.
- 'Function' is from 'dart:core'.
functionVar = xPotentiallyNullArg;
^" in xPotentiallyNullArg as{TypeError,ForNonNullableByDefault} core::Function;
- functionVar = let final Never #t112 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:206:17: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'Function'.
+ functionVar = let final Never #t110 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:206:17: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'Function'.
- 'Function' is from 'dart:core'.
functionVar = xPotentiallyNullNullableArg;
^" in xPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} core::Function;
- functionVar = let final Never #t113 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:207:17: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'Function'.
+ functionVar = let final Never #t111 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:207:17: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'Function'.
- 'Function' is from 'dart:core'.
functionVar = yNonNullArg;
^" in yNonNullArg as{TypeError,ForNonNullableByDefault} core::Function;
- functionVar = let final Never #t114 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:208:17: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'Function'.
+ functionVar = let final Never #t112 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:208:17: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'Function'.
- 'Function' is from 'dart:core'.
functionVar = yNonNullNullableArg;
^" in yNonNullNullableArg as{TypeError,ForNonNullableByDefault} core::Function;
- functionVar = let final Never #t115 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:209:17: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'Function'.
+ functionVar = let final Never #t113 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:209:17: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'Function'.
- 'Function' is from 'dart:core'.
functionVar = yPotentiallyNullArg;
^" in yPotentiallyNullArg as{TypeError,ForNonNullableByDefault} core::Function;
- functionVar = let final Never #t116 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:210:17: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'Function'.
+ functionVar = let final Never #t114 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:210:17: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'Function'.
- 'Function' is from 'dart:core'.
functionVar = yPotentiallyNullNullableArg;
^" in yPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} core::Function;
- () → void toVoidVar = let final Never #t117 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:212:31: Error: A value of type 'Object' can't be assigned to a variable of type 'void Function()'.
+ () → void toVoidVar = let final Never #t115 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:212:31: Error: A value of type 'Object' can't be assigned to a variable of type 'void Function()'.
- 'Object' is from 'dart:core'.
void Function() toVoidVar = objectArg;
^" in objectArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t118 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:213:15: Error: A value of type 'Object?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t116 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:213:15: Error: A value of type 'Object?' can't be assigned to a variable of type 'void Function()'.
- 'Object' is from 'dart:core'.
toVoidVar = objectNullableArg;
^" in objectNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t119 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:214:15: Error: A value of type 'num' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t117 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:214:15: Error: A value of type 'num' can't be assigned to a variable of type 'void Function()'.
toVoidVar = numArg;
^" in numArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t120 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:215:15: Error: A value of type 'num?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t118 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:215:15: Error: A value of type 'num?' can't be assigned to a variable of type 'void Function()'.
toVoidVar = numNullableArg;
^" in numNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t121 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:216:15: Error: A value of type 'int' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t119 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:216:15: Error: A value of type 'int' can't be assigned to a variable of type 'void Function()'.
toVoidVar = intArg;
^" in intArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t122 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:217:15: Error: A value of type 'int?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t120 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:217:15: Error: A value of type 'int?' can't be assigned to a variable of type 'void Function()'.
toVoidVar = intNullableArg;
^" in intNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t123 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:218:15: Error: A value of type 'double' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t121 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:218:15: Error: A value of type 'double' can't be assigned to a variable of type 'void Function()'.
toVoidVar = doubleArg;
^" in doubleArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t124 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:219:15: Error: A value of type 'double?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t122 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:219:15: Error: A value of type 'double?' can't be assigned to a variable of type 'void Function()'.
toVoidVar = doubleNullableArg;
^" in doubleNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t125 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:220:15: Error: A value of type 'Function' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t123 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:220:15: Error: A value of type 'Function' can't be assigned to a variable of type 'void Function()'.
- 'Function' is from 'dart:core'.
toVoidVar = functionArg;
^" in functionArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t126 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:221:15: Error: A value of type 'Function?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t124 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:221:15: Error: A value of type 'Function?' can't be assigned to a variable of type 'void Function()'.
- 'Function' is from 'dart:core'.
toVoidVar = functionNullableArg;
^" in functionNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t127 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:222:15: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'void Function()' because 'void Function()?' is nullable and 'void Function()' isn't.
+ toVoidVar = let final Never #t125 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:222:15: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'void Function()' because 'void Function()?' is nullable and 'void Function()' isn't.
toVoidVar = toVoidNullableArg;
- ^" in let () →? void #t128 = toVoidNullableArg in #t128.==(null) ?{() → void} #t128 as{TypeError,ForNonNullableByDefault} () → void : #t128{() → void};
- toVoidVar = let final Never #t129 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:223:15: Error: Can't tear off method 'call' from a potentially null value.
+ ^" in let () →? void #t126 = toVoidNullableArg in #t126.==(null) ?{() → void} #t126 as{TypeError,ForNonNullableByDefault} () → void : #t126{() → void};
+ toVoidVar = let final Never #t127 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:223:15: Error: Can't tear off method 'call' from a potentially null value.
toVoidVar = tearoffableNullableArg;
^" in tearoffableNullableArg as{TypeError} () → void;
- toVoidVar = let final Never #t130 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:224:15: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t128 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:224:15: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'void Function()'.
toVoidVar = xNonNullArg;
^" in xNonNullArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t131 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:225:15: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t129 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:225:15: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'void Function()'.
toVoidVar = xNonNullNullableArg;
^" in xNonNullNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t132 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:226:15: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t130 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:226:15: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'void Function()'.
toVoidVar = xPotentiallyNullArg;
^" in xPotentiallyNullArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t133 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:227:15: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t131 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:227:15: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'void Function()'.
toVoidVar = xPotentiallyNullNullableArg;
^" in xPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t134 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:228:15: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t132 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:228:15: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'void Function()'.
toVoidVar = yNonNullArg;
^" in yNonNullArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t135 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:229:15: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t133 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:229:15: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'void Function()'.
toVoidVar = yNonNullNullableArg;
^" in yNonNullNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t136 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:230:15: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t134 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:230:15: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'void Function()'.
toVoidVar = yPotentiallyNullArg;
^" in yPotentiallyNullArg as{TypeError,ForNonNullableByDefault} () → void;
- toVoidVar = let final Never #t137 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:231:15: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'void Function()'.
+ toVoidVar = let final Never #t135 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:231:15: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'void Function()'.
toVoidVar = yPotentiallyNullNullableArg;
^" in yPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} () → void;
- self::Tearoffable tearoffableVar = let final Never #t138 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:233:32: Error: A value of type 'Object' can't be assigned to a variable of type 'Tearoffable'.
+ self::Tearoffable tearoffableVar = let final Never #t136 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:233:32: Error: A value of type 'Object' can't be assigned to a variable of type 'Tearoffable'.
- 'Object' is from 'dart:core'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
Tearoffable tearoffableVar = objectArg;
^" in objectArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t139 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:234:20: Error: A value of type 'Object?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t137 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:234:20: Error: A value of type 'Object?' can't be assigned to a variable of type 'Tearoffable'.
- 'Object' is from 'dart:core'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = objectNullableArg;
^" in objectNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t140 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:235:20: Error: A value of type 'num' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t138 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:235:20: Error: A value of type 'num' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = numArg;
^" in numArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t141 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:236:20: Error: A value of type 'num?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t139 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:236:20: Error: A value of type 'num?' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = numNullableArg;
^" in numNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t142 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:237:20: Error: A value of type 'int' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t140 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:237:20: Error: A value of type 'int' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = intArg;
^" in intArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t143 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:238:20: Error: A value of type 'int?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t141 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:238:20: Error: A value of type 'int?' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = intNullableArg;
^" in intNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t144 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:239:20: Error: A value of type 'double' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t142 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:239:20: Error: A value of type 'double' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = doubleArg;
^" in doubleArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t145 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:240:20: Error: A value of type 'double?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t143 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:240:20: Error: A value of type 'double?' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = doubleNullableArg;
^" in doubleNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t146 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:241:20: Error: A value of type 'Function' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t144 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:241:20: Error: A value of type 'Function' can't be assigned to a variable of type 'Tearoffable'.
- 'Function' is from 'dart:core'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = functionArg;
^" in functionArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t147 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:242:20: Error: A value of type 'Function?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t145 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:242:20: Error: A value of type 'Function?' can't be assigned to a variable of type 'Tearoffable'.
- 'Function' is from 'dart:core'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = functionNullableArg;
^" in functionNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t148 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:243:20: Error: A value of type 'void Function()' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t146 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:243:20: Error: A value of type 'void Function()' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = toVoidArg;
^" in toVoidArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t149 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:244:20: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t147 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:244:20: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = toVoidNullableArg;
^" in toVoidNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t150 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:245:20: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'Tearoffable' because 'Tearoffable?' is nullable and 'Tearoffable' isn't.
+ tearoffableVar = let final Never #t148 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:245:20: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'Tearoffable' because 'Tearoffable?' is nullable and 'Tearoffable' isn't.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = tearoffableNullableArg;
- ^" in let self::Tearoffable? #t151 = tearoffableNullableArg in #t151.==(null) ?{self::Tearoffable} #t151 as{TypeError,ForNonNullableByDefault} self::Tearoffable : #t151{self::Tearoffable};
- tearoffableVar = let final Never #t152 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:246:20: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'Tearoffable'.
+ ^" in let self::Tearoffable? #t149 = tearoffableNullableArg in #t149.==(null) ?{self::Tearoffable} #t149 as{TypeError,ForNonNullableByDefault} self::Tearoffable : #t149{self::Tearoffable};
+ tearoffableVar = let final Never #t150 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:246:20: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = xNonNullArg;
^" in xNonNullArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t153 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:247:20: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t151 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:247:20: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = xNonNullNullableArg;
^" in xNonNullNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t154 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:248:20: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t152 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:248:20: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = xPotentiallyNullArg;
^" in xPotentiallyNullArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t155 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:249:20: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t153 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:249:20: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = xPotentiallyNullNullableArg;
^" in xPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t156 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:250:20: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t154 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:250:20: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = yNonNullArg;
^" in yNonNullArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t157 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:251:20: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t155 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:251:20: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = yNonNullNullableArg;
^" in yNonNullNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t158 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:252:20: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t156 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:252:20: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = yPotentiallyNullArg;
^" in yPotentiallyNullArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- tearoffableVar = let final Never #t159 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:253:20: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'Tearoffable'.
+ tearoffableVar = let final Never #t157 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:253:20: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'Tearoffable'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
tearoffableVar = yPotentiallyNullNullableArg;
^" in yPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} self::Tearoffable;
- self::error::XnonNull xNonNullVar = let final Never #t160 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:255:26: Error: A value of type 'Object' can't be assigned to a variable of type 'XnonNull'.
+ self::error::XnonNull xNonNullVar = let final Never #t158 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:255:26: Error: A value of type 'Object' can't be assigned to a variable of type 'XnonNull'.
- 'Object' is from 'dart:core'.
XnonNull xNonNullVar = objectArg;
^" in objectArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t161 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:256:17: Error: A value of type 'Object?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t159 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:256:17: Error: A value of type 'Object?' can't be assigned to a variable of type 'XnonNull'.
- 'Object' is from 'dart:core'.
xNonNullVar = objectNullableArg;
^" in objectNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t162 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:257:17: Error: A value of type 'num' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t160 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:257:17: Error: A value of type 'num' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = numArg;
^" in numArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t163 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:258:17: Error: A value of type 'num?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t161 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:258:17: Error: A value of type 'num?' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = numNullableArg;
^" in numNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t164 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:259:17: Error: A value of type 'int' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t162 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:259:17: Error: A value of type 'int' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = intArg;
^" in intArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t165 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:260:17: Error: A value of type 'int?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t163 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:260:17: Error: A value of type 'int?' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = intNullableArg;
^" in intNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t166 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:261:17: Error: A value of type 'double' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t164 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:261:17: Error: A value of type 'double' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = doubleArg;
^" in doubleArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t167 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:262:17: Error: A value of type 'double?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t165 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:262:17: Error: A value of type 'double?' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = doubleNullableArg;
^" in doubleNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t168 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:263:17: Error: A value of type 'Function' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t166 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:263:17: Error: A value of type 'Function' can't be assigned to a variable of type 'XnonNull'.
- 'Function' is from 'dart:core'.
xNonNullVar = functionArg;
^" in functionArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t169 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:264:17: Error: A value of type 'Function?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t167 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:264:17: Error: A value of type 'Function?' can't be assigned to a variable of type 'XnonNull'.
- 'Function' is from 'dart:core'.
xNonNullVar = functionNullableArg;
^" in functionNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t170 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:265:17: Error: A value of type 'void Function()' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t168 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:265:17: Error: A value of type 'void Function()' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = toVoidArg;
^" in toVoidArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t171 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:266:17: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t169 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:266:17: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = toVoidNullableArg;
^" in toVoidNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t172 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:267:17: Error: A value of type 'Tearoffable' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t170 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:267:17: Error: A value of type 'Tearoffable' can't be assigned to a variable of type 'XnonNull'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
xNonNullVar = tearoffableArg;
^" in tearoffableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t173 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:268:17: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t171 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:268:17: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'XnonNull'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
xNonNullVar = tearoffableNullableArg;
^" in tearoffableNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t174 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:269:17: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'XnonNull' because 'XnonNull?' is nullable and 'XnonNull' isn't.
+ xNonNullVar = let final Never #t172 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:269:17: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'XnonNull' because 'XnonNull?' is nullable and 'XnonNull' isn't.
xNonNullVar = xNonNullNullableArg;
^" in xNonNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t175 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:270:17: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t173 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:270:17: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = xPotentiallyNullArg;
^" in xPotentiallyNullArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t176 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:271:17: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t174 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:271:17: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = xPotentiallyNullNullableArg;
^" in xPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t177 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:272:17: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'XnonNull' because 'YnonNull?' is nullable and 'XnonNull' isn't.
+ xNonNullVar = let final Never #t175 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:272:17: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'XnonNull' because 'YnonNull?' is nullable and 'XnonNull' isn't.
xNonNullVar = yNonNullNullableArg;
^" in yNonNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t178 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:273:17: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t176 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:273:17: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = yPotentiallyNullArg;
^" in yPotentiallyNullArg as{TypeError,ForNonNullableByDefault} Never;
- xNonNullVar = let final Never #t179 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:274:17: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'XnonNull'.
+ xNonNullVar = let final Never #t177 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:274:17: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'XnonNull'.
xNonNullVar = yPotentiallyNullNullableArg;
^" in yPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- self::error::XpotentiallyNull% xPotentiallyNullVar = let final Never #t180 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:276:42: Error: A value of type 'Object' can't be assigned to a variable of type 'XpotentiallyNull'.
+ self::error::XpotentiallyNull% xPotentiallyNullVar = let final Never #t178 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:276:42: Error: A value of type 'Object' can't be assigned to a variable of type 'XpotentiallyNull'.
- 'Object' is from 'dart:core'.
XpotentiallyNull xPotentiallyNullVar = objectArg;
^" in objectArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t181 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:277:25: Error: A value of type 'Object?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t179 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:277:25: Error: A value of type 'Object?' can't be assigned to a variable of type 'XpotentiallyNull'.
- 'Object' is from 'dart:core'.
xPotentiallyNullVar = objectNullableArg;
^" in objectNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t182 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:278:25: Error: A value of type 'num' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t180 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:278:25: Error: A value of type 'num' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = numArg;
^" in numArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t183 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:279:25: Error: A value of type 'num?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t181 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:279:25: Error: A value of type 'num?' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = numNullableArg;
^" in numNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t184 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:280:25: Error: A value of type 'int' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t182 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:280:25: Error: A value of type 'int' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = intArg;
^" in intArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t185 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:281:25: Error: A value of type 'int?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t183 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:281:25: Error: A value of type 'int?' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = intNullableArg;
^" in intNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t186 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:282:25: Error: A value of type 'double' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t184 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:282:25: Error: A value of type 'double' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = doubleArg;
^" in doubleArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t187 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:283:25: Error: A value of type 'double?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t185 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:283:25: Error: A value of type 'double?' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = doubleNullableArg;
^" in doubleNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t188 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:284:25: Error: A value of type 'Function' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t186 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:284:25: Error: A value of type 'Function' can't be assigned to a variable of type 'XpotentiallyNull'.
- 'Function' is from 'dart:core'.
xPotentiallyNullVar = functionArg;
^" in functionArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t189 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:285:25: Error: A value of type 'Function?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t187 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:285:25: Error: A value of type 'Function?' can't be assigned to a variable of type 'XpotentiallyNull'.
- 'Function' is from 'dart:core'.
xPotentiallyNullVar = functionNullableArg;
^" in functionNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t190 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:286:25: Error: A value of type 'void Function()' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t188 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:286:25: Error: A value of type 'void Function()' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = toVoidArg;
^" in toVoidArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t191 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:287:25: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t189 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:287:25: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = toVoidNullableArg;
^" in toVoidNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t192 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:288:25: Error: A value of type 'Tearoffable' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t190 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:288:25: Error: A value of type 'Tearoffable' can't be assigned to a variable of type 'XpotentiallyNull'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
xPotentiallyNullVar = tearoffableArg;
^" in tearoffableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t193 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:289:25: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t191 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:289:25: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'XpotentiallyNull'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
xPotentiallyNullVar = tearoffableNullableArg;
^" in tearoffableNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t194 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:290:25: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t192 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:290:25: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = xNonNullArg;
^" in xNonNullArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t195 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:291:25: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t193 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:291:25: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = xNonNullNullableArg;
^" in xNonNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t196 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:292:25: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'XpotentiallyNull' because 'XpotentiallyNull?' is nullable and 'XpotentiallyNull' isn't.
+ xPotentiallyNullVar = let final Never #t194 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:292:25: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'XpotentiallyNull' because 'XpotentiallyNull?' is nullable and 'XpotentiallyNull' isn't.
xPotentiallyNullVar = xPotentiallyNullNullableArg;
^" in xPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t197 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:293:25: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t195 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:293:25: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = yNonNullArg;
^" in yNonNullArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t198 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:294:25: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'XpotentiallyNull'.
+ xPotentiallyNullVar = let final Never #t196 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:294:25: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'XpotentiallyNull'.
xPotentiallyNullVar = yNonNullNullableArg;
^" in yNonNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- xPotentiallyNullVar = let final Never #t199 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:295:25: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'XpotentiallyNull' because 'YpotentiallyNull?' is nullable and 'XpotentiallyNull' isn't.
+ xPotentiallyNullVar = let final Never #t197 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:295:25: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'XpotentiallyNull' because 'YpotentiallyNull?' is nullable and 'XpotentiallyNull' isn't.
xPotentiallyNullVar = yPotentiallyNullNullableArg;
^" in yPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- self::error::YnonNull yNonNullVar = let final Never #t200 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:297:26: Error: A value of type 'Object' can't be assigned to a variable of type 'YnonNull'.
+ self::error::YnonNull yNonNullVar = let final Never #t198 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:297:26: Error: A value of type 'Object' can't be assigned to a variable of type 'YnonNull'.
- 'Object' is from 'dart:core'.
YnonNull yNonNullVar = objectArg;
^" in objectArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t201 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:298:17: Error: A value of type 'Object?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t199 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:298:17: Error: A value of type 'Object?' can't be assigned to a variable of type 'YnonNull'.
- 'Object' is from 'dart:core'.
yNonNullVar = objectNullableArg;
^" in objectNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t202 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:299:17: Error: A value of type 'num' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t200 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:299:17: Error: A value of type 'num' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = numArg;
^" in numArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t203 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:300:17: Error: A value of type 'num?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t201 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:300:17: Error: A value of type 'num?' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = numNullableArg;
^" in numNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t204 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:301:17: Error: A value of type 'int' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t202 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:301:17: Error: A value of type 'int' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = intArg;
^" in intArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t205 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:302:17: Error: A value of type 'int?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t203 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:302:17: Error: A value of type 'int?' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = intNullableArg;
^" in intNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t206 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:303:17: Error: A value of type 'double' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t204 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:303:17: Error: A value of type 'double' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = doubleArg;
^" in doubleArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t207 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:304:17: Error: A value of type 'double?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t205 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:304:17: Error: A value of type 'double?' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = doubleNullableArg;
^" in doubleNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t208 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:305:17: Error: A value of type 'Function' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t206 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:305:17: Error: A value of type 'Function' can't be assigned to a variable of type 'YnonNull'.
- 'Function' is from 'dart:core'.
yNonNullVar = functionArg;
^" in functionArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t209 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:306:17: Error: A value of type 'Function?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t207 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:306:17: Error: A value of type 'Function?' can't be assigned to a variable of type 'YnonNull'.
- 'Function' is from 'dart:core'.
yNonNullVar = functionNullableArg;
^" in functionNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t210 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:307:17: Error: A value of type 'void Function()' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t208 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:307:17: Error: A value of type 'void Function()' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = toVoidArg;
^" in toVoidArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t211 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:308:17: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t209 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:308:17: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = toVoidNullableArg;
^" in toVoidNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t212 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:309:17: Error: A value of type 'Tearoffable' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t210 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:309:17: Error: A value of type 'Tearoffable' can't be assigned to a variable of type 'YnonNull'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
yNonNullVar = tearoffableArg;
^" in tearoffableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t213 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:310:17: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t211 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:310:17: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'YnonNull'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
yNonNullVar = tearoffableNullableArg;
^" in tearoffableNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t214 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:311:17: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t212 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:311:17: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = xNonNullArg;
^" in xNonNullArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t215 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:312:17: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t213 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:312:17: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = xNonNullNullableArg;
^" in xNonNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t216 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:313:17: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t214 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:313:17: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = xPotentiallyNullArg;
^" in xPotentiallyNullArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t217 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:314:17: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t215 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:314:17: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = xPotentiallyNullNullableArg;
^" in xPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t218 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:315:17: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'YnonNull' because 'YnonNull?' is nullable and 'YnonNull' isn't.
+ yNonNullVar = let final Never #t216 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:315:17: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'YnonNull' because 'YnonNull?' is nullable and 'YnonNull' isn't.
yNonNullVar = yNonNullNullableArg;
^" in yNonNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t219 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:316:17: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t217 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:316:17: Error: A value of type 'YpotentiallyNull' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = yPotentiallyNullArg;
^" in yPotentiallyNullArg as{TypeError,ForNonNullableByDefault} Never;
- yNonNullVar = let final Never #t220 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:317:17: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'YnonNull'.
+ yNonNullVar = let final Never #t218 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:317:17: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'YnonNull'.
yNonNullVar = yPotentiallyNullNullableArg;
^" in yPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- self::error::YpotentiallyNull% yPotentiallyNullVar = let final Never #t221 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:319:42: Error: A value of type 'Object' can't be assigned to a variable of type 'YpotentiallyNull'.
+ self::error::YpotentiallyNull% yPotentiallyNullVar = let final Never #t219 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:319:42: Error: A value of type 'Object' can't be assigned to a variable of type 'YpotentiallyNull'.
- 'Object' is from 'dart:core'.
YpotentiallyNull yPotentiallyNullVar = objectArg;
^" in objectArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t222 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:320:25: Error: A value of type 'Object?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t220 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:320:25: Error: A value of type 'Object?' can't be assigned to a variable of type 'YpotentiallyNull'.
- 'Object' is from 'dart:core'.
yPotentiallyNullVar = objectNullableArg;
^" in objectNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t223 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:321:25: Error: A value of type 'num' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t221 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:321:25: Error: A value of type 'num' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = numArg;
^" in numArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t224 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:322:25: Error: A value of type 'num?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t222 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:322:25: Error: A value of type 'num?' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = numNullableArg;
^" in numNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t225 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:323:25: Error: A value of type 'int' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t223 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:323:25: Error: A value of type 'int' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = intArg;
^" in intArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t226 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:324:25: Error: A value of type 'int?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t224 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:324:25: Error: A value of type 'int?' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = intNullableArg;
^" in intNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t227 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:325:25: Error: A value of type 'double' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t225 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:325:25: Error: A value of type 'double' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = doubleArg;
^" in doubleArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t228 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:326:25: Error: A value of type 'double?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t226 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:326:25: Error: A value of type 'double?' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = doubleNullableArg;
^" in doubleNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t229 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:327:25: Error: A value of type 'Function' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t227 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:327:25: Error: A value of type 'Function' can't be assigned to a variable of type 'YpotentiallyNull'.
- 'Function' is from 'dart:core'.
yPotentiallyNullVar = functionArg;
^" in functionArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t230 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:328:25: Error: A value of type 'Function?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t228 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:328:25: Error: A value of type 'Function?' can't be assigned to a variable of type 'YpotentiallyNull'.
- 'Function' is from 'dart:core'.
yPotentiallyNullVar = functionNullableArg;
^" in functionNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t231 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:329:25: Error: A value of type 'void Function()' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t229 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:329:25: Error: A value of type 'void Function()' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = toVoidArg;
^" in toVoidArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t232 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:330:25: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t230 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:330:25: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = toVoidNullableArg;
^" in toVoidNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t233 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:331:25: Error: A value of type 'Tearoffable' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t231 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:331:25: Error: A value of type 'Tearoffable' can't be assigned to a variable of type 'YpotentiallyNull'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
yPotentiallyNullVar = tearoffableArg;
^" in tearoffableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t234 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:332:25: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t232 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:332:25: Error: A value of type 'Tearoffable?' can't be assigned to a variable of type 'YpotentiallyNull'.
- 'Tearoffable' is from 'pkg/front_end/testcases/nnbd/assignability.dart'.
yPotentiallyNullVar = tearoffableNullableArg;
^" in tearoffableNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t235 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:333:25: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t233 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:333:25: Error: A value of type 'XnonNull' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = xNonNullArg;
^" in xNonNullArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t236 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:334:25: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t234 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:334:25: Error: A value of type 'XnonNull?' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = xNonNullNullableArg;
^" in xNonNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t237 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:335:25: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t235 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:335:25: Error: A value of type 'XpotentiallyNull' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = xPotentiallyNullArg;
^" in xPotentiallyNullArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t238 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:336:25: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t236 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:336:25: Error: A value of type 'XpotentiallyNull?' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = xPotentiallyNullNullableArg;
^" in xPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t239 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:337:25: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t237 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:337:25: Error: A value of type 'YnonNull' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = yNonNullArg;
^" in yNonNullArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t240 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:338:25: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'YpotentiallyNull'.
+ yPotentiallyNullVar = let final Never #t238 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:338:25: Error: A value of type 'YnonNull?' can't be assigned to a variable of type 'YpotentiallyNull'.
yPotentiallyNullVar = yNonNullNullableArg;
^" in yNonNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
- yPotentiallyNullVar = let final Never #t241 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:339:25: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'YpotentiallyNull' because 'YpotentiallyNull?' is nullable and 'YpotentiallyNull' isn't.
+ yPotentiallyNullVar = let final Never #t239 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:339:25: Error: A value of type 'YpotentiallyNull?' can't be assigned to a variable of type 'YpotentiallyNull' because 'YpotentiallyNull?' is nullable and 'YpotentiallyNull' isn't.
yPotentiallyNullVar = yPotentiallyNullNullableArg;
^" in yPotentiallyNullNullableArg as{TypeError,ForNonNullableByDefault} Never;
}
diff --git a/pkg/front_end/testcases/nnbd/assignability.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/assignability.dart.weak.transformed.expect
index 945c6ab..74dd324 100644
--- a/pkg/front_end/testcases/nnbd/assignability.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/assignability.dart.weak.transformed.expect
@@ -1324,11 +1324,11 @@
functionVar = let final Never #t85 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:200:17: Error: A value of type 'Function?' can't be assigned to a variable of type 'Function' because 'Function?' is nullable and 'Function' isn't.
- 'Function' is from 'dart:core'.
functionVar = functionNullableArg;
- ^" in functionNullableArg;
+ ^" in functionNullableArg as{TypeError,ForNonNullableByDefault} core::Function;
functionVar = let final Never #t86 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:201:17: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'Function' because 'void Function()?' is nullable and 'Function' isn't.
- 'Function' is from 'dart:core'.
functionVar = toVoidNullableArg;
- ^" in toVoidNullableArg;
+ ^" in toVoidNullableArg as{TypeError,ForNonNullableByDefault} core::Function;
functionVar = let final Never #t87 = invalid-expression "pkg/front_end/testcases/nnbd/assignability.dart:202:17: Error: Can't tear off method 'call' from a potentially null value.
functionVar = tearoffableNullableArg;
^" in tearoffableNullableArg as{TypeError} core::Function;
diff --git a/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib1.dart b/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib1.dart
index 1943b6e..c904869 100644
--- a/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib1.dart
+++ b/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib1.dart
@@ -2,6 +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.5
+// @dart=2.9
class LegacyClass1 {}
diff --git a/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib2.dart b/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib2.dart
index 1723c1f..c68b9f9 100644
--- a/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib2.dart
+++ b/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib2.dart
@@ -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.5
+// @dart=2.9
class LegacyClass3 {}
diff --git a/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib3.dart b/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib3.dart
index 148a845..6dbe951 100644
--- a/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib3.dart
+++ b/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib3.dart
@@ -2,16 +2,14 @@
// 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.5
+// @dart=2.9
export 'export_from_opt_out_lib5.dart';
-class LegacyClass2 {
-}
+class LegacyClass2 {}
legacyMethod1() {}
-extension LegacyExtension on String {
-}
+extension LegacyExtension on String {}
-typedef LegacyTypedef = void Function();
\ No newline at end of file
+typedef LegacyTypedef = void Function();
diff --git a/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib4.dart b/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib4.dart
index 5a7261a..612326d 100644
--- a/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib4.dart
+++ b/pkg/front_end/testcases/nnbd_mixed/export_from_opt_out_lib4.dart
@@ -2,6 +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.5
+// @dart=2.9
export 'export_from_opt_out_lib5.dart';
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.expect
index 8de447c..fb500ca 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.expect
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.expect
@@ -2,7 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable.
// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
// FutureOr<AAlias> foLegacyNonNullable = null; // error
// ^
@@ -21,11 +21,11 @@
typedef AAliasNonNullable = opt::A;
typedef AAliasNullable = opt::A?;
static method test() → dynamic {
- FutureOr<opt::A>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
+ FutureOr<() → opt::A*>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable.
- 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
FutureOr<AAlias> foLegacyNonNullable = null; // error
- ^" in null as{TypeError,ForNonNullableByDefault} FutureOr<opt::A>;
- FutureOr<opt::A?>foLegacyNullable = null;
+ ^" in null as{TypeError,ForNonNullableByDefault} FutureOr<() → opt::A*>;
+ FutureOr<() →? opt::A*>foLegacyNullable = null;
FutureOr<opt::A>foNonNullable = let final Never #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
- 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
FutureOr<AAliasNonNullable> foNonNullable = null; // error
@@ -50,7 +50,7 @@
import "dart:async";
import "org-dartlang-testcase:///issue41501.dart";
-typedef AAlias = opt::A*;
+typedef AAlias = () →* opt::A*;
class A extends core::Object {
synthetic constructor •() → opt::A*
: super core::Object::•()
@@ -67,7 +67,7 @@
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
}
static method test() → dynamic {
- FutureOr<opt::A*>* foLegacy = null;
+ FutureOr<() →* opt::A*>* foLegacy = null;
FutureOr<opt::A*>* foNonNullable = null;
FutureOr<opt::A*>* foNullable = null;
}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.transformed.expect
index a59394b..af7457b 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable.
// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
// FutureOr<AAlias> foLegacyNonNullable = null; // error
// ^
@@ -21,11 +21,11 @@
typedef AAliasNonNullable = opt::A;
typedef AAliasNullable = opt::A?;
static method test() → dynamic {
- FutureOr<opt::A>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
+ FutureOr<() → opt::A*>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable.
- 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
FutureOr<AAlias> foLegacyNonNullable = null; // error
- ^" in let Null #t2 = null in #t2.==(null) ?{FutureOr<opt::A>} #t2 as{TypeError,ForNonNullableByDefault} FutureOr<opt::A> : #t2{FutureOr<opt::A>};
- FutureOr<opt::A?>foLegacyNullable = null;
+ ^" in let Null #t2 = null in #t2.==(null) ?{FutureOr<() → opt::A*>} #t2 as{TypeError,ForNonNullableByDefault} FutureOr<() → opt::A*> : #t2{FutureOr<() → opt::A*>};
+ FutureOr<() →? opt::A*>foLegacyNullable = null;
FutureOr<opt::A>foNonNullable = let final Never #t3 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
- 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
FutureOr<AAliasNonNullable> foNonNullable = null; // error
@@ -50,7 +50,7 @@
import "dart:async";
import "org-dartlang-testcase:///issue41501.dart";
-typedef AAlias = opt::A*;
+typedef AAlias = () →* opt::A*;
class A extends core::Object {
synthetic constructor •() → opt::A*
: super core::Object::•()
@@ -67,7 +67,7 @@
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
}
static method test() → dynamic {
- FutureOr<opt::A*>* foLegacy = null;
+ FutureOr<() →* opt::A*>* foLegacy = null;
FutureOr<opt::A*>* foNonNullable = null;
FutureOr<opt::A*>* foNullable = null;
}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect
index c86c3be..a709e0b 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect
@@ -2,7 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable.
// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
// FutureOr<AAlias> foLegacyNonNullable = null; // error
// ^
@@ -21,11 +21,11 @@
typedef AAliasNonNullable = opt::A;
typedef AAliasNullable = opt::A?;
static method test() → dynamic {
- FutureOr<opt::A>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
+ FutureOr<() → opt::A*>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable.
- 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
FutureOr<AAlias> foLegacyNonNullable = null; // error
- ^" in null as{TypeError,ForNonNullableByDefault} FutureOr<opt::A>;
- FutureOr<opt::A?>foLegacyNullable = null;
+ ^" in null as{TypeError,ForNonNullableByDefault} FutureOr<() → opt::A*>;
+ FutureOr<() →? opt::A*>foLegacyNullable = null;
FutureOr<opt::A>foNonNullable = let final Never #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
- 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
FutureOr<AAliasNonNullable> foNonNullable = null; // error
@@ -43,7 +43,7 @@
import "dart:async";
import "org-dartlang-testcase:///issue41501.dart";
-typedef AAlias = opt::A*;
+typedef AAlias = () →* opt::A*;
class A extends core::Object {
synthetic constructor •() → opt::A*
: super core::Object::•()
@@ -60,7 +60,7 @@
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
}
static method test() → dynamic {
- FutureOr<opt::A*>* foLegacy = null;
+ FutureOr<() →* opt::A*>* foLegacy = null;
FutureOr<opt::A*>* foNonNullable = null;
FutureOr<opt::A*>* foNullable = null;
}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.outline.expect
index 1b2a115..da69458 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.outline.expect
@@ -19,7 +19,7 @@
import "dart:async";
import "org-dartlang-testcase:///issue41501.dart";
-typedef AAlias = opt::A*;
+typedef AAlias = () →* opt::A*;
class A extends core::Object {
synthetic constructor •() → opt::A*
;
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect
index b82561c..a75d478 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect
@@ -2,7 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable.
// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
// FutureOr<AAlias> foLegacyNonNullable = null; // error
// ^
@@ -21,11 +21,11 @@
typedef AAliasNonNullable = opt::A;
typedef AAliasNullable = opt::A?;
static method test() → dynamic {
- FutureOr<opt::A>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
+ FutureOr<() → opt::A*>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable.
- 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
FutureOr<AAlias> foLegacyNonNullable = null; // error
^" in null;
- FutureOr<opt::A?>foLegacyNullable = null;
+ FutureOr<() →? opt::A*>foLegacyNullable = null;
FutureOr<opt::A>foNonNullable = let final Never #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable.
- 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
FutureOr<AAliasNonNullable> foNonNullable = null; // error
@@ -43,7 +43,7 @@
import "dart:async";
import "org-dartlang-testcase:///issue41501.dart";
-typedef AAlias = opt::A*;
+typedef AAlias = () →* opt::A*;
class A extends core::Object {
synthetic constructor •() → opt::A*
: super core::Object::•()
@@ -60,7 +60,7 @@
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
}
static method test() → dynamic {
- FutureOr<opt::A*>* foLegacy = null;
+ FutureOr<() →* opt::A*>* foLegacy = null;
FutureOr<opt::A*>* foNonNullable = null;
FutureOr<opt::A*>* foNullable = null;
}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart
index 09e20d1..e026cd9 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart
@@ -11,11 +11,10 @@
class A {}
-typedef AAlias = A;
+typedef AAlias = A Function();
test() {
FutureOr<AAlias> foLegacy = null; // ok
FutureOr<AAliasNonNullable> foNonNullable = null; // ok
FutureOr<AAliasNullable> foNullable = null; // ok
}
-
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart
new file mode 100644
index 0000000..ed569dc
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart
@@ -0,0 +1,52 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+Type? _capturedTypeArgument;
+
+X captureTypeArgument<X>() {
+ _capturedTypeArgument = X;
+ print("X: $X");
+ throw "Error";
+}
+
+class A<X extends A<X>> {}
+typedef C<X extends A<X>> = A<X>;
+
+void topLevel1<X extends A<X>>(A<X> Function() g) => g();
+
+void topLevel2<X extends C<X>>(C<X> Function() g) => g();
+
+class Class {
+ void instance1<X extends A<X>>(A<X> Function() g) => g();
+
+ void instance2<X extends C<X>>(C<X> Function() g) => g();
+
+ void test() {
+ void local1<X extends A<X>>(A<X> Function() g) => g();
+ void local2<X extends C<X>>(C<X> Function() g) => g();
+
+ var f1 = local1;
+ var f2 = local2;
+
+ new A();
+ new C();
+ f1(() => captureTypeArgument());
+ f2(() => captureTypeArgument());
+ local1(() => captureTypeArgument());
+ local2(() => captureTypeArgument());
+ topLevel1(() => captureTypeArgument());
+ topLevel2(() => captureTypeArgument());
+ instance1(() => captureTypeArgument());
+ instance2(() => captureTypeArgument());
+ }
+}
+
+class Subclass extends Class {
+ void test() {
+ super.instance1(() => captureTypeArgument());
+ super.instance2(() => captureTypeArgument());
+ }
+}
+
+main() {}
\ No newline at end of file
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.strong.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.strong.expect
new file mode 100644
index 0000000..15fe25b
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.strong.expect
@@ -0,0 +1,160 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:32:9: Error: Inferred type argument 'A<Object?>' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'A'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Object' is from 'dart:core'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// new A();
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:13:9: Context: This is the type variable whose bound isn't conformed to.
+// class A<X extends A<X>> {}
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:33:9: Error: Inferred type argument 'A<Object?>' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'A'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Object' is from 'dart:core'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// new C();
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:13:9: Context: This is the type variable whose bound isn't conformed to.
+// class A<X extends A<X>> {}
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:34:7: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'call'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:35:7: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'call'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:36:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'local1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:37:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'local2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:38:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'topLevel1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// topLevel1(() => captureTypeArgument());
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:16:16: Context: This is the type variable whose bound isn't conformed to.
+// void topLevel1<X extends A<X>>(A<X> Function() g) => g();
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:39:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'topLevel2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// topLevel2(() => captureTypeArgument());
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:18:16: Context: This is the type variable whose bound isn't conformed to.
+// void topLevel2<X extends C<X>>(C<X> Function() g) => g();
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:40:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Class.instance1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Class' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// instance1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:41:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Class.instance2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Class' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// instance2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:47:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Subclass.instance1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Subclass' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// super.instance1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:48:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Subclass.instance2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Subclass' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// super.instance2(() => captureTypeArgument());
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef C<X extends self::A<X> = self::A<dynamic>> = self::A<X>;
+class A<X extends self::A<self::A::X> = self::A<dynamic>> extends core::Object {
+ synthetic constructor •() → self::A<self::A::X>
+ : super core::Object::•()
+ ;
+}
+class Class extends core::Object {
+ synthetic constructor •() → self::Class
+ : super core::Object::•()
+ ;
+ method instance1<X extends self::A<self::Class::instance1::X> = self::A<dynamic>>(() → self::A<self::Class::instance1::X> g) → void
+ return g.call();
+ method instance2<X extends self::A<self::Class::instance2::X> = self::A<dynamic>>(() → self::A<self::Class::instance2::X> g) → void
+ return g.call();
+ method test() → void {
+ function local1<X extends self::A<X> = self::A<dynamic>>(() → self::A<X> g) → void
+ return g.call();
+ function local2<X extends self::A<X> = self::A<dynamic>>(() → self::A<X> g) → void
+ return g.call();
+ <X extends self::A<X> = self::A<dynamic>>(() → self::A<X>) → void f1 = local1;
+ <X extends self::A<X> = self::A<dynamic>>(() → self::A<X>) → void f2 = local2;
+ new self::A::•<self::A<core::Object?>>();
+ new self::A::•<self::A<core::Object?>>();
+ f1.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ f2.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ local1.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ local2.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ self::topLevel1<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ self::topLevel2<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ this.{self::Class::instance1}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ this.{self::Class::instance2}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ }
+}
+class Subclass extends self::Class {
+ synthetic constructor •() → self::Subclass
+ : super self::Class::•()
+ ;
+ method test() → void {
+ super.{self::Class::instance1}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ super.{self::Class::instance2}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ }
+}
+static field core::Type? _capturedTypeArgument;
+static method captureTypeArgument<X extends core::Object? = dynamic>() → self::captureTypeArgument::X% {
+ self::_capturedTypeArgument = self::captureTypeArgument::X%;
+ core::print("X: ${self::captureTypeArgument::X%}");
+ throw "Error";
+}
+static method topLevel1<X extends self::A<self::topLevel1::X> = self::A<dynamic>>(() → self::A<self::topLevel1::X> g) → void
+ return g.call();
+static method topLevel2<X extends self::A<self::topLevel2::X> = self::A<dynamic>>(() → self::A<self::topLevel2::X> g) → void
+ return g.call();
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.strong.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.strong.transformed.expect
new file mode 100644
index 0000000..15fe25b
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.strong.transformed.expect
@@ -0,0 +1,160 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:32:9: Error: Inferred type argument 'A<Object?>' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'A'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Object' is from 'dart:core'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// new A();
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:13:9: Context: This is the type variable whose bound isn't conformed to.
+// class A<X extends A<X>> {}
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:33:9: Error: Inferred type argument 'A<Object?>' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'A'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Object' is from 'dart:core'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// new C();
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:13:9: Context: This is the type variable whose bound isn't conformed to.
+// class A<X extends A<X>> {}
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:34:7: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'call'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:35:7: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'call'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:36:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'local1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:37:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'local2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:38:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'topLevel1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// topLevel1(() => captureTypeArgument());
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:16:16: Context: This is the type variable whose bound isn't conformed to.
+// void topLevel1<X extends A<X>>(A<X> Function() g) => g();
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:39:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'topLevel2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// topLevel2(() => captureTypeArgument());
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:18:16: Context: This is the type variable whose bound isn't conformed to.
+// void topLevel2<X extends C<X>>(C<X> Function() g) => g();
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:40:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Class.instance1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Class' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// instance1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:41:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Class.instance2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Class' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// instance2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:47:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Subclass.instance1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Subclass' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// super.instance1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:48:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Subclass.instance2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Subclass' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// super.instance2(() => captureTypeArgument());
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef C<X extends self::A<X> = self::A<dynamic>> = self::A<X>;
+class A<X extends self::A<self::A::X> = self::A<dynamic>> extends core::Object {
+ synthetic constructor •() → self::A<self::A::X>
+ : super core::Object::•()
+ ;
+}
+class Class extends core::Object {
+ synthetic constructor •() → self::Class
+ : super core::Object::•()
+ ;
+ method instance1<X extends self::A<self::Class::instance1::X> = self::A<dynamic>>(() → self::A<self::Class::instance1::X> g) → void
+ return g.call();
+ method instance2<X extends self::A<self::Class::instance2::X> = self::A<dynamic>>(() → self::A<self::Class::instance2::X> g) → void
+ return g.call();
+ method test() → void {
+ function local1<X extends self::A<X> = self::A<dynamic>>(() → self::A<X> g) → void
+ return g.call();
+ function local2<X extends self::A<X> = self::A<dynamic>>(() → self::A<X> g) → void
+ return g.call();
+ <X extends self::A<X> = self::A<dynamic>>(() → self::A<X>) → void f1 = local1;
+ <X extends self::A<X> = self::A<dynamic>>(() → self::A<X>) → void f2 = local2;
+ new self::A::•<self::A<core::Object?>>();
+ new self::A::•<self::A<core::Object?>>();
+ f1.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ f2.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ local1.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ local2.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ self::topLevel1<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ self::topLevel2<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ this.{self::Class::instance1}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ this.{self::Class::instance2}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ }
+}
+class Subclass extends self::Class {
+ synthetic constructor •() → self::Subclass
+ : super self::Class::•()
+ ;
+ method test() → void {
+ super.{self::Class::instance1}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ super.{self::Class::instance2}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ }
+}
+static field core::Type? _capturedTypeArgument;
+static method captureTypeArgument<X extends core::Object? = dynamic>() → self::captureTypeArgument::X% {
+ self::_capturedTypeArgument = self::captureTypeArgument::X%;
+ core::print("X: ${self::captureTypeArgument::X%}");
+ throw "Error";
+}
+static method topLevel1<X extends self::A<self::topLevel1::X> = self::A<dynamic>>(() → self::A<self::topLevel1::X> g) → void
+ return g.call();
+static method topLevel2<X extends self::A<self::topLevel2::X> = self::A<dynamic>>(() → self::A<self::topLevel2::X> g) → void
+ return g.call();
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.textual_outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.textual_outline.expect
new file mode 100644
index 0000000..daa08cb
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.textual_outline.expect
@@ -0,0 +1,15 @@
+Type? _capturedTypeArgument;
+X captureTypeArgument<X>() {}
+class A<X extends A<X>> {}
+typedef C<X extends A<X>> = A<X>;
+void topLevel1<X extends A<X>>(A<X> Function() g) => g();
+void topLevel2<X extends C<X>>(C<X> Function() g) => g();
+class Class {
+ void instance1<X extends A<X>>(A<X> Function() g) => g();
+ void instance2<X extends C<X>>(C<X> Function() g) => g();
+ void test() {}
+}
+class Subclass extends Class {
+ void test() {}
+}
+main() {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.expect
new file mode 100644
index 0000000..15fe25b
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.expect
@@ -0,0 +1,160 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:32:9: Error: Inferred type argument 'A<Object?>' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'A'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Object' is from 'dart:core'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// new A();
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:13:9: Context: This is the type variable whose bound isn't conformed to.
+// class A<X extends A<X>> {}
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:33:9: Error: Inferred type argument 'A<Object?>' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'A'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Object' is from 'dart:core'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// new C();
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:13:9: Context: This is the type variable whose bound isn't conformed to.
+// class A<X extends A<X>> {}
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:34:7: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'call'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:35:7: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'call'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:36:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'local1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:37:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'local2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:38:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'topLevel1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// topLevel1(() => captureTypeArgument());
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:16:16: Context: This is the type variable whose bound isn't conformed to.
+// void topLevel1<X extends A<X>>(A<X> Function() g) => g();
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:39:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'topLevel2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// topLevel2(() => captureTypeArgument());
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:18:16: Context: This is the type variable whose bound isn't conformed to.
+// void topLevel2<X extends C<X>>(C<X> Function() g) => g();
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:40:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Class.instance1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Class' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// instance1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:41:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Class.instance2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Class' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// instance2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:47:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Subclass.instance1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Subclass' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// super.instance1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:48:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Subclass.instance2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Subclass' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// super.instance2(() => captureTypeArgument());
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef C<X extends self::A<X> = self::A<dynamic>> = self::A<X>;
+class A<X extends self::A<self::A::X> = self::A<dynamic>> extends core::Object {
+ synthetic constructor •() → self::A<self::A::X>
+ : super core::Object::•()
+ ;
+}
+class Class extends core::Object {
+ synthetic constructor •() → self::Class
+ : super core::Object::•()
+ ;
+ method instance1<X extends self::A<self::Class::instance1::X> = self::A<dynamic>>(() → self::A<self::Class::instance1::X> g) → void
+ return g.call();
+ method instance2<X extends self::A<self::Class::instance2::X> = self::A<dynamic>>(() → self::A<self::Class::instance2::X> g) → void
+ return g.call();
+ method test() → void {
+ function local1<X extends self::A<X> = self::A<dynamic>>(() → self::A<X> g) → void
+ return g.call();
+ function local2<X extends self::A<X> = self::A<dynamic>>(() → self::A<X> g) → void
+ return g.call();
+ <X extends self::A<X> = self::A<dynamic>>(() → self::A<X>) → void f1 = local1;
+ <X extends self::A<X> = self::A<dynamic>>(() → self::A<X>) → void f2 = local2;
+ new self::A::•<self::A<core::Object?>>();
+ new self::A::•<self::A<core::Object?>>();
+ f1.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ f2.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ local1.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ local2.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ self::topLevel1<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ self::topLevel2<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ this.{self::Class::instance1}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ this.{self::Class::instance2}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ }
+}
+class Subclass extends self::Class {
+ synthetic constructor •() → self::Subclass
+ : super self::Class::•()
+ ;
+ method test() → void {
+ super.{self::Class::instance1}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ super.{self::Class::instance2}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ }
+}
+static field core::Type? _capturedTypeArgument;
+static method captureTypeArgument<X extends core::Object? = dynamic>() → self::captureTypeArgument::X% {
+ self::_capturedTypeArgument = self::captureTypeArgument::X%;
+ core::print("X: ${self::captureTypeArgument::X%}");
+ throw "Error";
+}
+static method topLevel1<X extends self::A<self::topLevel1::X> = self::A<dynamic>>(() → self::A<self::topLevel1::X> g) → void
+ return g.call();
+static method topLevel2<X extends self::A<self::topLevel2::X> = self::A<dynamic>>(() → self::A<self::topLevel2::X> g) → void
+ return g.call();
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.outline.expect
new file mode 100644
index 0000000..a1218a1
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.outline.expect
@@ -0,0 +1,34 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+typedef C<X extends self::A<X> = self::A<dynamic>> = self::A<X>;
+class A<X extends self::A<self::A::X> = self::A<dynamic>> extends core::Object {
+ synthetic constructor •() → self::A<self::A::X>
+ ;
+}
+class Class extends core::Object {
+ synthetic constructor •() → self::Class
+ ;
+ method instance1<X extends self::A<self::Class::instance1::X> = self::A<dynamic>>(() → self::A<self::Class::instance1::X> g) → void
+ ;
+ method instance2<X extends self::A<self::Class::instance2::X> = self::A<dynamic>>(() → self::A<self::Class::instance2::X> g) → void
+ ;
+ method test() → void
+ ;
+}
+class Subclass extends self::Class {
+ synthetic constructor •() → self::Subclass
+ ;
+ method test() → void
+ ;
+}
+static field core::Type? _capturedTypeArgument;
+static method captureTypeArgument<X extends core::Object? = dynamic>() → self::captureTypeArgument::X%
+ ;
+static method topLevel1<X extends self::A<self::topLevel1::X> = self::A<dynamic>>(() → self::A<self::topLevel1::X> g) → void
+ ;
+static method topLevel2<X extends self::A<self::topLevel2::X> = self::A<dynamic>>(() → self::A<self::topLevel2::X> g) → void
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.transformed.expect
new file mode 100644
index 0000000..15fe25b
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart.weak.transformed.expect
@@ -0,0 +1,160 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:32:9: Error: Inferred type argument 'A<Object?>' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'A'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Object' is from 'dart:core'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// new A();
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:13:9: Context: This is the type variable whose bound isn't conformed to.
+// class A<X extends A<X>> {}
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:33:9: Error: Inferred type argument 'A<Object?>' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'A'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Object' is from 'dart:core'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// new C();
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:13:9: Context: This is the type variable whose bound isn't conformed to.
+// class A<X extends A<X>> {}
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:34:7: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'call'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:35:7: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'call'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// f2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:36:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'local1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:37:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'local2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// local2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:38:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'topLevel1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// topLevel1(() => captureTypeArgument());
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:16:16: Context: This is the type variable whose bound isn't conformed to.
+// void topLevel1<X extends A<X>>(A<X> Function() g) => g();
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:39:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'topLevel2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// topLevel2(() => captureTypeArgument());
+// ^
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:18:16: Context: This is the type variable whose bound isn't conformed to.
+// void topLevel2<X extends C<X>>(C<X> Function() g) => g();
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:40:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Class.instance1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Class' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// instance1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:41:5: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Class.instance2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Class' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// instance2(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:47:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Subclass.instance1'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Subclass' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// super.instance1(() => captureTypeArgument());
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart:48:11: Error: Inferred type argument 'Object?' doesn't conform to the bound 'A<X>' of the type variable 'X' on 'Subclass.instance2'.
+// - 'Object' is from 'dart:core'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// - 'Subclass' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue45464.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// super.instance2(() => captureTypeArgument());
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef C<X extends self::A<X> = self::A<dynamic>> = self::A<X>;
+class A<X extends self::A<self::A::X> = self::A<dynamic>> extends core::Object {
+ synthetic constructor •() → self::A<self::A::X>
+ : super core::Object::•()
+ ;
+}
+class Class extends core::Object {
+ synthetic constructor •() → self::Class
+ : super core::Object::•()
+ ;
+ method instance1<X extends self::A<self::Class::instance1::X> = self::A<dynamic>>(() → self::A<self::Class::instance1::X> g) → void
+ return g.call();
+ method instance2<X extends self::A<self::Class::instance2::X> = self::A<dynamic>>(() → self::A<self::Class::instance2::X> g) → void
+ return g.call();
+ method test() → void {
+ function local1<X extends self::A<X> = self::A<dynamic>>(() → self::A<X> g) → void
+ return g.call();
+ function local2<X extends self::A<X> = self::A<dynamic>>(() → self::A<X> g) → void
+ return g.call();
+ <X extends self::A<X> = self::A<dynamic>>(() → self::A<X>) → void f1 = local1;
+ <X extends self::A<X> = self::A<dynamic>>(() → self::A<X>) → void f2 = local2;
+ new self::A::•<self::A<core::Object?>>();
+ new self::A::•<self::A<core::Object?>>();
+ f1.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ f2.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ local1.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ local2.call<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ self::topLevel1<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ self::topLevel2<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ this.{self::Class::instance1}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ this.{self::Class::instance2}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ }
+}
+class Subclass extends self::Class {
+ synthetic constructor •() → self::Subclass
+ : super self::Class::•()
+ ;
+ method test() → void {
+ super.{self::Class::instance1}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ super.{self::Class::instance2}<core::Object?>(() → self::A<core::Object?> => self::captureTypeArgument<self::A<core::Object?>>());
+ }
+}
+static field core::Type? _capturedTypeArgument;
+static method captureTypeArgument<X extends core::Object? = dynamic>() → self::captureTypeArgument::X% {
+ self::_capturedTypeArgument = self::captureTypeArgument::X%;
+ core::print("X: ${self::captureTypeArgument::X%}");
+ throw "Error";
+}
+static method topLevel1<X extends self::A<self::topLevel1::X> = self::A<dynamic>>(() → self::A<self::topLevel1::X> g) → void
+ return g.call();
+static method topLevel2<X extends self::A<self::topLevel2::X> = self::A<dynamic>>(() → self::A<self::topLevel2::X> g) → void
+ return g.call();
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart
similarity index 89%
rename from pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart
rename to pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart
index 0e9dfeb..17fef52 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart
@@ -1,10 +1,12 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// 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.9
-import "issue_43084_lib.dart";
+
+import 'issue_43084_lib.dart';
main() {
Bar<int> x = new Bar<int>();
print(x);
-}
\ No newline at end of file
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.strong.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.strong.expect
new file mode 100644
index 0000000..a8a2594
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.strong.expect
@@ -0,0 +1,29 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
+// // @dart=2.9
+// ^^^^^^^^^^^^
+//
+import self as self;
+import "issue_43084_lib.dart" as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue_43084_lib.dart";
+
+static method main() → dynamic {
+ iss::Foo<core::int*>* x = new iss::Foo::•<core::int*>();
+ core::print(x);
+}
+
+library /*isNonNullableByDefault*/;
+import self as iss;
+import "dart:core" as core;
+
+typedef Bar<X extends core::Object? = dynamic> = iss::Foo<X%>;
+class Foo<X extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → iss::Foo<iss::Foo::X%>
+ : super core::Object::•()
+ ;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.strong.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.strong.transformed.expect
new file mode 100644
index 0000000..a8a2594
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.strong.transformed.expect
@@ -0,0 +1,29 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
+// // @dart=2.9
+// ^^^^^^^^^^^^
+//
+import self as self;
+import "issue_43084_lib.dart" as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue_43084_lib.dart";
+
+static method main() → dynamic {
+ iss::Foo<core::int*>* x = new iss::Foo::•<core::int*>();
+ core::print(x);
+}
+
+library /*isNonNullableByDefault*/;
+import self as iss;
+import "dart:core" as core;
+
+typedef Bar<X extends core::Object? = dynamic> = iss::Foo<X%>;
+class Foo<X extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → iss::Foo<iss::Foo::X%>
+ : super core::Object::•()
+ ;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.textual_outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.textual_outline.expect
new file mode 100644
index 0000000..e51aa89
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.textual_outline.expect
@@ -0,0 +1,4 @@
+// @dart = 2.9
+import 'issue_43084_lib.dart';
+
+main() {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..e51aa89
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.textual_outline_modelled.expect
@@ -0,0 +1,4 @@
+// @dart = 2.9
+import 'issue_43084_lib.dart';
+
+main() {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.expect
new file mode 100644
index 0000000..fd22d37
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.expect
@@ -0,0 +1,22 @@
+library;
+import self as self;
+import "issue_43084_lib.dart" as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue_43084_lib.dart";
+
+static method main() → dynamic {
+ iss::Foo<core::int*>* x = new iss::Foo::•<core::int*>();
+ core::print(x);
+}
+
+library /*isNonNullableByDefault*/;
+import self as iss;
+import "dart:core" as core;
+
+typedef Bar<X extends core::Object? = dynamic> = iss::Foo<X%>;
+class Foo<X extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → iss::Foo<iss::Foo::X%>
+ : super core::Object::•()
+ ;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.outline.expect
new file mode 100644
index 0000000..91de9ad
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.outline.expect
@@ -0,0 +1,17 @@
+library;
+import self as self;
+
+import "org-dartlang-testcase:///issue_43084_lib.dart";
+
+static method main() → dynamic
+ ;
+
+library /*isNonNullableByDefault*/;
+import self as self2;
+import "dart:core" as core;
+
+typedef Bar<X extends core::Object? = dynamic> = self2::Foo<X%>;
+class Foo<X extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self2::Foo<self2::Foo::X%>
+ ;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.transformed.expect
new file mode 100644
index 0000000..fd22d37
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084.dart.weak.transformed.expect
@@ -0,0 +1,22 @@
+library;
+import self as self;
+import "issue_43084_lib.dart" as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue_43084_lib.dart";
+
+static method main() → dynamic {
+ iss::Foo<core::int*>* x = new iss::Foo::•<core::int*>();
+ core::print(x);
+}
+
+library /*isNonNullableByDefault*/;
+import self as iss;
+import "dart:core" as core;
+
+typedef Bar<X extends core::Object? = dynamic> = iss::Foo<X%>;
+class Foo<X extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → iss::Foo<iss::Foo::X%>
+ : super core::Object::•()
+ ;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084_lib.dart b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084_lib.dart
similarity index 94%
rename from pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084_lib.dart
rename to pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084_lib.dart
index 647ad1d..75163af 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084_lib.dart
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/issue_43084_lib.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// 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.9
+
class Foo<X> {
}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/test.options b/pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/test.options
similarity index 100%
rename from pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/test.options
rename to pkg/front_end/testcases/nonfunction_type_aliases/issue_43084/test.options
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084_lib.dart b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart
similarity index 79%
copy from pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084_lib.dart
copy to pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart
index 647ad1d..932fe93 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084_lib.dart
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart
@@ -1,8 +1,9 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// 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.9
-class Foo<X> {
-}
-typedef Bar<X> = Foo<X>;
\ No newline at end of file
+// @dart = 2.12
+
+typedef A = int;
+
+void main() {}
\ No newline at end of file
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.strong.expect b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.strong.expect
new file mode 100644
index 0000000..104aeb2
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.strong.expect
@@ -0,0 +1,12 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart:7:11: Error: Can't create typedef from non-function type.
+// typedef A = int;
+// ^
+//
+import self as self;
+
+typedef A = invalid-type;
+static method main() → void {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.strong.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.strong.transformed.expect
new file mode 100644
index 0000000..104aeb2
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.strong.transformed.expect
@@ -0,0 +1,12 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart:7:11: Error: Can't create typedef from non-function type.
+// typedef A = int;
+// ^
+//
+import self as self;
+
+typedef A = invalid-type;
+static method main() → void {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.textual_outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.textual_outline.expect
new file mode 100644
index 0000000..14f266b
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.textual_outline.expect
@@ -0,0 +1,3 @@
+// @dart = 2.12
+typedef A = int;
+void main() {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.expect b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.expect
new file mode 100644
index 0000000..104aeb2
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.expect
@@ -0,0 +1,12 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart:7:11: Error: Can't create typedef from non-function type.
+// typedef A = int;
+// ^
+//
+import self as self;
+
+typedef A = invalid-type;
+static method main() → void {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.outline.expect
new file mode 100644
index 0000000..2f9bbe5
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.outline.expect
@@ -0,0 +1,13 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart:7:11: Error: Can't create typedef from non-function type.
+// typedef A = int;
+// ^
+//
+import self as self;
+
+typedef A = invalid-type;
+static method main() → void
+ ;
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.transformed.expect
new file mode 100644
index 0000000..104aeb2
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart.weak.transformed.expect
@@ -0,0 +1,12 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/old_version.dart:7:11: Error: Can't create typedef from non-function type.
+// typedef A = int;
+// ^
+//
+import self as self;
+
+typedef A = invalid-type;
+static method main() → void {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/folder.options b/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/folder.options
deleted file mode 100644
index f1e0c43..0000000
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/folder.options
+++ /dev/null
@@ -1 +0,0 @@
---enable-experiment=nonfunction-type-aliases
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.textual_outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.textual_outline.expect
deleted file mode 100644
index 9591f62..0000000
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.textual_outline.expect
+++ /dev/null
@@ -1,4 +0,0 @@
-// @dart = 2.9
-import "issue_43084_lib.dart";
-
-main() {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.textual_outline_modelled.expect
deleted file mode 100644
index 9591f62..0000000
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.textual_outline_modelled.expect
+++ /dev/null
@@ -1,4 +0,0 @@
-// @dart = 2.9
-import "issue_43084_lib.dart";
-
-main() {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.expect b/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.expect
deleted file mode 100644
index e216ebf..0000000
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.expect
+++ /dev/null
@@ -1,32 +0,0 @@
-library;
-import self as self;
-import "issue_43084_lib.dart" as iss;
-import "dart:core" as core;
-
-import "org-dartlang-testcase:///issue_43084_lib.dart";
-
-static method main() → dynamic {
- iss::Foo<core::int*>* x = new iss::Foo::•<core::int*>();
- core::print(x);
-}
-
-library;
-import self as iss;
-import "dart:core" as core;
-
-typedef Bar<X extends core::Object* = dynamic> = iss::Foo<X*>*;
-class Foo<X extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → iss::Foo<iss::Foo::X*>*
- : super core::Object::•()
- ;
- 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
-}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.outline.expect
deleted file mode 100644
index 796c6b3..0000000
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.outline.expect
+++ /dev/null
@@ -1,27 +0,0 @@
-library;
-import self as self;
-
-import "org-dartlang-testcase:///issue_43084_lib.dart";
-
-static method main() → dynamic
- ;
-
-library;
-import self as self2;
-import "dart:core" as core;
-
-typedef Bar<X extends core::Object* = dynamic> = self2::Foo<X*>*;
-class Foo<X extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self2::Foo<self2::Foo::X*>*
- ;
- 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
-}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.transformed.expect
deleted file mode 100644
index e216ebf..0000000
--- a/pkg/front_end/testcases/nonfunction_type_aliases_no_nnbd/issue_43084/issue_43084.dart.weak.transformed.expect
+++ /dev/null
@@ -1,32 +0,0 @@
-library;
-import self as self;
-import "issue_43084_lib.dart" as iss;
-import "dart:core" as core;
-
-import "org-dartlang-testcase:///issue_43084_lib.dart";
-
-static method main() → dynamic {
- iss::Foo<core::int*>* x = new iss::Foo::•<core::int*>();
- core::print(x);
-}
-
-library;
-import self as iss;
-import "dart:core" as core;
-
-typedef Bar<X extends core::Object* = dynamic> = iss::Foo<X*>*;
-class Foo<X extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → iss::Foo<iss::Foo::X*>*
- : super core::Object::•()
- ;
- 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
-}
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
index 2e8ba10..55f591f 100644
--- a/pkg/front_end/testcases/text_serialization.status
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -66,6 +66,7 @@
general/error_recovery/yield_not_in_generator: RuntimeError
general/expressions: RuntimeError
general/external_import: RuntimeError
+general/function_invocation_bounds: TypeCheckError
general/getter_vs_setter_type: TypeCheckError
general/incomplete_field_formal_parameter: RuntimeError
general/infer_field_from_multiple: TypeCheckError
diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status
index 6585a37..13ce720 100644
--- a/pkg/front_end/testcases/textual_outline.status
+++ b/pkg/front_end/testcases/textual_outline.status
@@ -32,8 +32,10 @@
general/clone_function_type: FormatterCrash
general/constants/js_semantics/issue45376: FormatterCrash
general/constants/js_semantics/number_folds: FormatterCrash
+general/constants/js_semantics/number_folds_opt_out: FormatterCrash
general/constants/js_semantics/on_double: FormatterCrash
general/constants/number_folds: FormatterCrash
+general/constants/number_folds_opt_out: FormatterCrash
general/constants/various: FormatterCrash
general/constructor_initializer_invalid: FormatterCrash
general/duplicated_declarations: FormatterCrash
@@ -132,7 +134,9 @@
nonfunction_type_aliases/issue41501: FormatterCrash
nonfunction_type_aliases/issue42446: FormatterCrash
nonfunction_type_aliases/issue45051: FormatterCrash
+nonfunction_type_aliases/issue45464: FormatterCrash
nonfunction_type_aliases/nullable_supertypes: FormatterCrash
+nonfunction_type_aliases/old_version: FormatterCrash
nonfunction_type_aliases/unaliased_bounds_checks_in_constructor_calls: FormatterCrash
rasta/bad_redirection: FormatterCrash
rasta/issue_000032: FormatterCrash
diff --git a/pkg/front_end/testcases/triple_shift/invalid_operator.dart b/pkg/front_end/testcases/triple_shift/invalid_operator.dart
index 9e33989..97cbba7 100644
--- a/pkg/front_end/testcases/triple_shift/invalid_operator.dart
+++ b/pkg/front_end/testcases/triple_shift/invalid_operator.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// 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.9
+
class Operators1 {
operator >>>() => true;
}
diff --git a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.strong.expect b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.strong.expect
index 4fc7537..86bba08 100644
--- a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.strong.expect
+++ b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.strong.expect
@@ -1,11 +1,7 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
-// pkg/front_end/testcases/triple_shift/invalid_operator.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety.
-// // @dart=2.9
-// ^^^^^^^^^^^^
-//
// pkg/front_end/testcases/triple_shift/invalid_operator.dart:6:12: Error: Operator '>>>' should have exactly one parameter.
// operator >>>() => true;
// ^^^
@@ -39,123 +35,53 @@
import "dart:core" as core;
class Operators1 extends core::Object {
- synthetic constructor •() → self::Operators1*
+ synthetic constructor •() → self::Operators1
: super core::Object::•()
;
operator >>>() → dynamic
return true;
- 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 Operators2 extends core::Object {
- synthetic constructor •() → self::Operators2*
+ synthetic constructor •() → self::Operators2
: super core::Object::•()
;
operator >>>(dynamic a, dynamic b) → dynamic
return true;
- 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 Operators3 extends core::Object {
- synthetic constructor •() → self::Operators3*
+ synthetic constructor •() → self::Operators3
: super core::Object::•()
;
operator >>>([dynamic a = #C1]) → dynamic
return true;
- 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 Operators4 extends core::Object {
- synthetic constructor •() → self::Operators4*
+ synthetic constructor •() → self::Operators4
: super core::Object::•()
;
operator >>>({dynamic a = #C1}) → dynamic
return true;
- 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 Operators5 extends core::Object {
- synthetic constructor •() → self::Operators5*
+ synthetic constructor •() → self::Operators5
: super core::Object::•()
;
operator >>>(dynamic a, [dynamic b = #C1]) → dynamic
return true;
- 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 Operators6 extends core::Object {
- synthetic constructor •() → self::Operators6*
+ synthetic constructor •() → self::Operators6
: super core::Object::•()
;
operator >>>(dynamic a, {dynamic b = #C1}) → dynamic
return true;
- 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 Operators7 extends core::Object {
- synthetic constructor •() → self::Operators7*
+ synthetic constructor •() → self::Operators7
: super core::Object::•()
;
- operator >>><T extends core::Object* = dynamic>(dynamic a) → dynamic
+ operator >>><T extends core::Object? = dynamic>(dynamic a) → dynamic
return true;
- 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
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.strong.transformed.expect b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.strong.transformed.expect
index 4fc7537..86bba08 100644
--- a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.strong.transformed.expect
@@ -1,11 +1,7 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
-// pkg/front_end/testcases/triple_shift/invalid_operator.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety.
-// // @dart=2.9
-// ^^^^^^^^^^^^
-//
// pkg/front_end/testcases/triple_shift/invalid_operator.dart:6:12: Error: Operator '>>>' should have exactly one parameter.
// operator >>>() => true;
// ^^^
@@ -39,123 +35,53 @@
import "dart:core" as core;
class Operators1 extends core::Object {
- synthetic constructor •() → self::Operators1*
+ synthetic constructor •() → self::Operators1
: super core::Object::•()
;
operator >>>() → dynamic
return true;
- 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 Operators2 extends core::Object {
- synthetic constructor •() → self::Operators2*
+ synthetic constructor •() → self::Operators2
: super core::Object::•()
;
operator >>>(dynamic a, dynamic b) → dynamic
return true;
- 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 Operators3 extends core::Object {
- synthetic constructor •() → self::Operators3*
+ synthetic constructor •() → self::Operators3
: super core::Object::•()
;
operator >>>([dynamic a = #C1]) → dynamic
return true;
- 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 Operators4 extends core::Object {
- synthetic constructor •() → self::Operators4*
+ synthetic constructor •() → self::Operators4
: super core::Object::•()
;
operator >>>({dynamic a = #C1}) → dynamic
return true;
- 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 Operators5 extends core::Object {
- synthetic constructor •() → self::Operators5*
+ synthetic constructor •() → self::Operators5
: super core::Object::•()
;
operator >>>(dynamic a, [dynamic b = #C1]) → dynamic
return true;
- 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 Operators6 extends core::Object {
- synthetic constructor •() → self::Operators6*
+ synthetic constructor •() → self::Operators6
: super core::Object::•()
;
operator >>>(dynamic a, {dynamic b = #C1}) → dynamic
return true;
- 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 Operators7 extends core::Object {
- synthetic constructor •() → self::Operators7*
+ synthetic constructor •() → self::Operators7
: super core::Object::•()
;
- operator >>><T extends core::Object* = dynamic>(dynamic a) → dynamic
+ operator >>><T extends core::Object? = dynamic>(dynamic a) → dynamic
return true;
- 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
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.textual_outline.expect b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.textual_outline.expect
index 0c9cae8..a449983 100644
--- a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.textual_outline.expect
@@ -1,4 +1,3 @@
-// @dart = 2.9
class Operators1 {
operator >>(){}
operator>() => true;
diff --git a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.expect b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.expect
index a5258fd..86bba08 100644
--- a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.expect
+++ b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -35,123 +35,53 @@
import "dart:core" as core;
class Operators1 extends core::Object {
- synthetic constructor •() → self::Operators1*
+ synthetic constructor •() → self::Operators1
: super core::Object::•()
;
operator >>>() → dynamic
return true;
- 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 Operators2 extends core::Object {
- synthetic constructor •() → self::Operators2*
+ synthetic constructor •() → self::Operators2
: super core::Object::•()
;
operator >>>(dynamic a, dynamic b) → dynamic
return true;
- 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 Operators3 extends core::Object {
- synthetic constructor •() → self::Operators3*
+ synthetic constructor •() → self::Operators3
: super core::Object::•()
;
operator >>>([dynamic a = #C1]) → dynamic
return true;
- 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 Operators4 extends core::Object {
- synthetic constructor •() → self::Operators4*
+ synthetic constructor •() → self::Operators4
: super core::Object::•()
;
operator >>>({dynamic a = #C1}) → dynamic
return true;
- 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 Operators5 extends core::Object {
- synthetic constructor •() → self::Operators5*
+ synthetic constructor •() → self::Operators5
: super core::Object::•()
;
operator >>>(dynamic a, [dynamic b = #C1]) → dynamic
return true;
- 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 Operators6 extends core::Object {
- synthetic constructor •() → self::Operators6*
+ synthetic constructor •() → self::Operators6
: super core::Object::•()
;
operator >>>(dynamic a, {dynamic b = #C1}) → dynamic
return true;
- 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 Operators7 extends core::Object {
- synthetic constructor •() → self::Operators7*
+ synthetic constructor •() → self::Operators7
: super core::Object::•()
;
- operator >>><T extends core::Object* = dynamic>(dynamic a) → dynamic
+ operator >>><T extends core::Object? = dynamic>(dynamic a) → dynamic
return true;
- 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
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.outline.expect b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.outline.expect
index d2a1d7f..34eccb8 100644
--- a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.outline.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -35,116 +35,46 @@
import "dart:core" as core;
class Operators1 extends core::Object {
- synthetic constructor •() → self::Operators1*
+ synthetic constructor •() → self::Operators1
;
operator >>>() → dynamic
;
- 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 Operators2 extends core::Object {
- synthetic constructor •() → self::Operators2*
+ synthetic constructor •() → self::Operators2
;
operator >>>(dynamic a, dynamic b) → dynamic
;
- 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 Operators3 extends core::Object {
- synthetic constructor •() → self::Operators3*
+ synthetic constructor •() → self::Operators3
;
operator >>>([dynamic a]) → dynamic
;
- 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 Operators4 extends core::Object {
- synthetic constructor •() → self::Operators4*
+ synthetic constructor •() → self::Operators4
;
operator >>>({dynamic a}) → dynamic
;
- 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 Operators5 extends core::Object {
- synthetic constructor •() → self::Operators5*
+ synthetic constructor •() → self::Operators5
;
operator >>>(dynamic a, [dynamic b]) → dynamic
;
- 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 Operators6 extends core::Object {
- synthetic constructor •() → self::Operators6*
+ synthetic constructor •() → self::Operators6
;
operator >>>(dynamic a, {dynamic b}) → dynamic
;
- 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 Operators7 extends core::Object {
- synthetic constructor •() → self::Operators7*
+ synthetic constructor •() → self::Operators7
;
- operator >>><T extends core::Object* = dynamic>(dynamic a) → dynamic
+ operator >>><T extends core::Object? = dynamic>(dynamic a) → dynamic
;
- 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
}
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.transformed.expect b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.transformed.expect
index a5258fd..86bba08 100644
--- a/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/triple_shift/invalid_operator.dart.weak.transformed.expect
@@ -1,4 +1,4 @@
-library;
+library /*isNonNullableByDefault*/;
//
// Problems in library:
//
@@ -35,123 +35,53 @@
import "dart:core" as core;
class Operators1 extends core::Object {
- synthetic constructor •() → self::Operators1*
+ synthetic constructor •() → self::Operators1
: super core::Object::•()
;
operator >>>() → dynamic
return true;
- 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 Operators2 extends core::Object {
- synthetic constructor •() → self::Operators2*
+ synthetic constructor •() → self::Operators2
: super core::Object::•()
;
operator >>>(dynamic a, dynamic b) → dynamic
return true;
- 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 Operators3 extends core::Object {
- synthetic constructor •() → self::Operators3*
+ synthetic constructor •() → self::Operators3
: super core::Object::•()
;
operator >>>([dynamic a = #C1]) → dynamic
return true;
- 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 Operators4 extends core::Object {
- synthetic constructor •() → self::Operators4*
+ synthetic constructor •() → self::Operators4
: super core::Object::•()
;
operator >>>({dynamic a = #C1}) → dynamic
return true;
- 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 Operators5 extends core::Object {
- synthetic constructor •() → self::Operators5*
+ synthetic constructor •() → self::Operators5
: super core::Object::•()
;
operator >>>(dynamic a, [dynamic b = #C1]) → dynamic
return true;
- 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 Operators6 extends core::Object {
- synthetic constructor •() → self::Operators6*
+ synthetic constructor •() → self::Operators6
: super core::Object::•()
;
operator >>>(dynamic a, {dynamic b = #C1}) → dynamic
return true;
- 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 Operators7 extends core::Object {
- synthetic constructor •() → self::Operators7*
+ synthetic constructor •() → self::Operators7
: super core::Object::•()
;
- operator >>><T extends core::Object* = dynamic>(dynamic a) → dynamic
+ operator >>><T extends core::Object? = dynamic>(dynamic a) → dynamic
return true;
- 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
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart
index 1aea4d3..71aa5cf 100644
--- a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart
+++ b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// 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.9
+
class A<out X, in Y, inout Z> {}
main() {
diff --git a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.textual_outline.expect b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.textual_outline.expect
index b4adc16..eaa0557 100644
--- a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.textual_outline.expect
@@ -1,3 +1,2 @@
-// @dart = 2.9
class A<out X, in Y, inout Z> {}
main() {}
diff --git a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.expect b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.expect
index 6d3f0f2..14e8ddf 100644
--- a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.expect
+++ b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.expect
@@ -1,22 +1,12 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-class A<X extends core::Object* = dynamic, contravariant Y extends core::Object* = dynamic, invariant Z extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::A<self::A::X*, self::A::Y*, self::A::Z*>*
+class A<X extends core::Object? = dynamic, contravariant Y extends core::Object? = dynamic, invariant Z extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::A<self::A::X%, self::A::Y%, self::A::Z%>
: super core::Object::•()
;
- 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
}
static method main() → dynamic {
- self::A<dynamic, dynamic, dynamic>* a = new self::A::•<dynamic, dynamic, dynamic>();
+ self::A<dynamic, dynamic, dynamic> a = new self::A::•<dynamic, dynamic, dynamic>();
}
diff --git a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.outline.expect b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.outline.expect
index 6031980..4f9e525 100644
--- a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.outline.expect
@@ -1,20 +1,10 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-class A<X extends core::Object* = dynamic, contravariant Y extends core::Object* = dynamic, invariant Z extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::A<self::A::X*, self::A::Y*, self::A::Z*>*
+class A<X extends core::Object? = dynamic, contravariant Y extends core::Object? = dynamic, invariant Z extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::A<self::A::X%, self::A::Y%, self::A::Z%>
;
- 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
}
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.transformed.expect b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.transformed.expect
index 6d3f0f2..14e8ddf 100644
--- a/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/variance/class_type_parameter_modifier.dart.weak.transformed.expect
@@ -1,22 +1,12 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-class A<X extends core::Object* = dynamic, contravariant Y extends core::Object* = dynamic, invariant Z extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::A<self::A::X*, self::A::Y*, self::A::Z*>*
+class A<X extends core::Object? = dynamic, contravariant Y extends core::Object? = dynamic, invariant Z extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::A<self::A::X%, self::A::Y%, self::A::Z%>
: super core::Object::•()
;
- 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
}
static method main() → dynamic {
- self::A<dynamic, dynamic, dynamic>* a = new self::A::•<dynamic, dynamic, dynamic>();
+ self::A<dynamic, dynamic, dynamic> a = new self::A::•<dynamic, dynamic, dynamic>();
}
diff --git a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart
index 1d1c133..983db1d 100644
--- a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart
+++ b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart
@@ -1,16 +1,16 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// 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.9
+
typedef ContraFunction<T> = void Function(T);
typedef InvFunction<T> = T Function(T);
class Contravariant<in T> {}
class Invariant<inout T> {}
class A<in T, out U, V> {
- final void Function(T) field = null;
+ final void Function(T)? field = null;
void method(T t, void Function(U) u, V v) {}
- void method2(T x, [T y]) {}
+ void method2(T x, [T? y]) {}
void set x(T t) {}
Map<U, Contravariant<V>> get mapContra => new Map<U, Contravariant<V>>();
Map<U, ContraFunction<V>> get mapContraFn => new Map<U, ContraFunction<V>>();
@@ -19,14 +19,14 @@
}
class B<inout T> {
- T x;
+ T? x;
T method(T x) => x;
void set y(T x) {}
}
class C<in T> {
- final void Function(T) field = null;
- void method(T x, [T y]) {}
+ final void Function(T)? field = null;
+ void method(T x, [T? y]) {}
void set x(T t) {}
}
@@ -39,6 +39,7 @@
E(this.f);
int method(T x) {
f(x);
+ return 0;
}
}
diff --git a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.textual_outline.expect b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.textual_outline.expect
index aa7684d..375b737 100644
--- a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.textual_outline.expect
@@ -1,12 +1,11 @@
-// @dart = 2.9
typedef ContraFunction<T> = void Function(T);
typedef InvFunction<T> = T Function(T);
class Contravariant<in T> {}
class Invariant<inout T> {}
class A<in T, out U, V> {
- final void Function(T) field = null;
+ final void Function(T)? field = null;
void method(T t, void Function(U) u, V v) {}
- void method2(T x, [T y]) {}
+ void method2(T x, [T? y]) {}
void set x(T t) {}
Map<U, Contravariant<V>> get mapContra => new Map<U, Contravariant<V>>();
Map<U, ContraFunction<V>> get mapContraFn => new Map<U, ContraFunction<V>>();
@@ -14,13 +13,13 @@
Map<U, InvFunction<V>> get mapInvFn => new Map<U, InvFunction<V>>();
}
class B<inout T> {
- T x;
+ T? x;
T method(T x) => x;
void set y(T x) {}
}
class C<in T> {
- final void Function(T) field = null;
- void method(T x, [T y]) {}
+ final void Function(T)? field = null;
+ void method(T x, [T? y]) {}
void set x(T t) {}
}
abstract class D<T> {
diff --git a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.expect b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.expect
index 4b64468..fbf4052 100644
--- a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.expect
+++ b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.expect
@@ -1,191 +1,113 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-typedef ContraFunction<contravariant T extends core::Object* = dynamic> = (T*) →* void;
-typedef InvFunction<invariant T extends core::Object* = dynamic> = (T*) →* T*;
-class Contravariant<contravariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Contravariant<self::Contravariant::T*>*
+typedef ContraFunction<contravariant T extends core::Object? = dynamic> = (T%) → void;
+typedef InvFunction<invariant T extends core::Object? = dynamic> = (T%) → T%;
+class Contravariant<contravariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Contravariant<self::Contravariant::T%>
: super core::Object::•()
;
- 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 Invariant<invariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Invariant<self::Invariant::T*>*
+class Invariant<invariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Invariant<self::Invariant::T%>
: super core::Object::•()
;
- 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 A<contravariant T extends core::Object* = dynamic, U extends core::Object* = dynamic, V extends core::Object* = dynamic> extends core::Object {
- final field (self::A::T*) →* void field = null;
- synthetic constructor •() → self::A<self::A::T*, self::A::U*, self::A::V*>*
+class A<contravariant T extends core::Object? = dynamic, U extends core::Object? = dynamic, V extends core::Object? = dynamic> extends core::Object {
+ final field (self::A::T%) →? void field = null;
+ synthetic constructor •() → self::A<self::A::T%, self::A::U%, self::A::V%>
: super core::Object::•()
;
- method method(self::A::T* t, (self::A::U*) →* void u, generic-covariant-impl self::A::V* v) → void {}
- method method2(self::A::T* x, [self::A::T* y = #C1]) → void {}
- set x(self::A::T* t) → void {}
- get mapContra() → core::Map<self::A::U*, self::Contravariant<self::A::V*>*>*
- return core::Map::•<self::A::U*, self::Contravariant<self::A::V*>*>();
- get mapContraFn() → core::Map<self::A::U*, (self::A::V*) →* void>*
- return core::Map::•<self::A::U*, (self::A::V*) →* void>();
- get mapInv() → core::Map<self::A::U*, self::Invariant<self::A::V*>*>*
- return core::Map::•<self::A::U*, self::Invariant<self::A::V*>*>();
- get mapInvFn() → core::Map<self::A::U*, (self::A::V*) →* self::A::V*>*
- return core::Map::•<self::A::U*, (self::A::V*) →* self::A::V*>();
- 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(self::A::T% t, (self::A::U%) → void u, generic-covariant-impl self::A::V% v) → void {}
+ method method2(self::A::T% x, [self::A::T? y = #C1]) → void {}
+ set x(self::A::T% t) → void {}
+ get mapContra() → core::Map<self::A::U%, self::Contravariant<self::A::V%>>
+ return core::Map::•<self::A::U%, self::Contravariant<self::A::V%>>();
+ get mapContraFn() → core::Map<self::A::U%, (self::A::V%) → void>
+ return core::Map::•<self::A::U%, (self::A::V%) → void>();
+ get mapInv() → core::Map<self::A::U%, self::Invariant<self::A::V%>>
+ return core::Map::•<self::A::U%, self::Invariant<self::A::V%>>();
+ get mapInvFn() → core::Map<self::A::U%, (self::A::V%) → self::A::V%>
+ return core::Map::•<self::A::U%, (self::A::V%) → self::A::V%>();
}
-class B<invariant T extends core::Object* = dynamic> extends core::Object {
- field self::B::T* x = null;
- synthetic constructor •() → self::B<self::B::T*>*
+class B<invariant T extends core::Object? = dynamic> extends core::Object {
+ field self::B::T? x = null;
+ synthetic constructor •() → self::B<self::B::T%>
: super core::Object::•()
;
- method method(self::B::T* x) → self::B::T*
+ method method(self::B::T% x) → self::B::T%
return x;
- set y(self::B::T* x) → void {}
- abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
- 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 get runtimeType() → core::Type*; -> core::Object::runtimeType
+ set y(self::B::T% x) → void {}
}
-class C<contravariant T extends core::Object* = dynamic> extends core::Object {
- final field (self::C::T*) →* void field = null;
- synthetic constructor •() → self::C<self::C::T*>*
+class C<contravariant T extends core::Object? = dynamic> extends core::Object {
+ final field (self::C::T%) →? void field = null;
+ synthetic constructor •() → self::C<self::C::T%>
: super core::Object::•()
;
- method method(self::C::T* x, [self::C::T* y = #C1]) → void {}
- set x(self::C::T* t) → 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(self::C::T% x, [self::C::T? y = #C1]) → void {}
+ set x(self::C::T% t) → void {}
}
-abstract class D<T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::D<self::D::T*>*
+abstract class D<T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::D<self::D::T%>
: super core::Object::•()
;
- abstract method method(generic-covariant-impl self::D::T* x) → core::int*;
- 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 method method(generic-covariant-impl self::D::T% x) → core::int;
}
-class E<invariant T extends core::Object* = dynamic> extends core::Object {
- final field (self::E::T*) →* void f;
- constructor •((self::E::T*) →* void f) → self::E<self::E::T*>*
+class E<invariant T extends core::Object? = dynamic> extends core::Object {
+ final field (self::E::T%) → void f;
+ constructor •((self::E::T%) → void f) → self::E<self::E::T%>
: self::E::f = f, super core::Object::•()
;
- method method(self::E::T* x) → core::int* {
- let final self::E::T* #t1 = x in this.{self::E::f}.call(#t1);
+ method method(self::E::T% x) → core::int {
+ let final self::E::T% #t1 = x in this.{self::E::f}.call(#t1);
+ return 0;
}
- 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 F<invariant T extends core::Object* = dynamic> extends self::E<self::F::T*> implements self::D<self::F::T*> {
- constructor •((self::F::T*) →* void f) → self::F<self::F::T*>*
+class F<invariant T extends core::Object? = dynamic> extends self::E<self::F::T%> implements self::D<self::F::T%> {
+ constructor •((self::F::T%) → void f) → self::F<self::F::T%>
: super self::E::•(f)
;
- forwarding-stub method method(generic-covariant-impl self::F::T* x) → core::int*
+ forwarding-stub method method(generic-covariant-impl self::F::T% x) → core::int
return super.{self::E::method}(x);
}
-class NoSuchMethod<invariant T extends core::Object* = dynamic> extends core::Object implements self::B<self::NoSuchMethod::T*> {
- synthetic constructor •() → self::NoSuchMethod<self::NoSuchMethod::T*>*
+class NoSuchMethod<invariant T extends core::Object? = dynamic> extends core::Object implements self::B<self::NoSuchMethod::T%> {
+ synthetic constructor •() → self::NoSuchMethod<self::NoSuchMethod::T%>
: super core::Object::•()
;
- method noSuchMethod(core::Invocation* _) → dynamic
+ method noSuchMethod(core::Invocation _) → dynamic
return 3;
- 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 get runtimeType() → core::Type*; -> core::Object::runtimeType
- no-such-method-forwarder get x() → self::NoSuchMethod::T*
- return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic} self::NoSuchMethod::T*;
- no-such-method-forwarder method method(self::NoSuchMethod::T* x) → self::NoSuchMethod::T*
- return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic} self::NoSuchMethod::T*;
- no-such-method-forwarder set y(self::NoSuchMethod::T* x) → void
+ no-such-method-forwarder get x() → self::NoSuchMethod::T?
+ return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic,ForNonNullableByDefault} self::NoSuchMethod::T?;
+ no-such-method-forwarder method method(self::NoSuchMethod::T% x) → self::NoSuchMethod::T%
+ return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic,ForNonNullableByDefault} self::NoSuchMethod::T%;
+ no-such-method-forwarder set y(self::NoSuchMethod::T% x) → void
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 2, #C3, core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5)));
- no-such-method-forwarder set x(self::NoSuchMethod::T* value) → void
+ no-such-method-forwarder set x(self::NoSuchMethod::T? value) → void
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 2, #C3, core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5)));
}
static method main() → dynamic {
- self::A<core::int*, core::num*, core::String*>* a = new self::A::•<core::int*, core::num*, core::String*>();
+ self::A<core::int, core::num, core::String> a = new self::A::•<core::int, core::num, core::String>();
self::expect(null, a.{self::A::field});
- a.{self::A::method}(3, (core::num* num) → Null {}, "test");
+ a.{self::A::method}(3, (core::num num) → void {}, "test");
a.{self::A::method2}(3);
a.{self::A::x} = 3;
- core::Map<core::num*, self::Contravariant<core::String*>*>* mapContra = a.{self::A::mapContra} as{TypeError,CovarianceCheck} core::Map<core::num*, self::Contravariant<core::String*>*>*;
- core::Map<core::num*, (core::String*) →* void>* mapContraFn = a.{self::A::mapContraFn} as{TypeError,CovarianceCheck} core::Map<core::num*, (core::String*) →* void>*;
- core::Map<core::num*, self::Invariant<core::String*>*>* mapInv = a.{self::A::mapInv} as{TypeError,CovarianceCheck} core::Map<core::num*, self::Invariant<core::String*>*>*;
- core::Map<core::num*, (core::String*) →* core::String*>* mapInvFn = a.{self::A::mapInvFn} as{TypeError,CovarianceCheck} core::Map<core::num*, (core::String*) →* core::String*>*;
- self::B<core::int*>* b = new self::B::•<core::int*>();
+ core::Map<core::num, self::Contravariant<core::String>> mapContra = a.{self::A::mapContra} as{TypeError,CovarianceCheck,ForNonNullableByDefault} core::Map<core::num, self::Contravariant<core::String>>;
+ core::Map<core::num, (core::String) → void> mapContraFn = a.{self::A::mapContraFn} as{TypeError,CovarianceCheck,ForNonNullableByDefault} core::Map<core::num, (core::String) → void>;
+ core::Map<core::num, self::Invariant<core::String>> mapInv = a.{self::A::mapInv} as{TypeError,CovarianceCheck,ForNonNullableByDefault} core::Map<core::num, self::Invariant<core::String>>;
+ core::Map<core::num, (core::String) → core::String> mapInvFn = a.{self::A::mapInvFn} as{TypeError,CovarianceCheck,ForNonNullableByDefault} core::Map<core::num, (core::String) → core::String>;
+ self::B<core::int> b = new self::B::•<core::int>();
b.{self::B::x} = 3;
self::expect(3, b.{self::B::x});
self::expect(3, b.{self::B::method}(3));
b.{self::B::y} = 3;
- self::C<core::int*>* c = new self::C::•<core::int*>();
+ self::C<core::int> c = new self::C::•<core::int>();
self::expect(null, c.{self::C::field});
c.{self::C::method}(3, 2);
c.{self::C::x} = 3;
- self::D<core::Object*>* d = new self::F::•<core::String*>((core::String* s) → Null {});
+ self::D<core::Object> d = new self::F::•<core::String>((core::String s) → void {});
d.{self::D::method}("test");
- self::NoSuchMethod<core::num*>* nsm = new self::NoSuchMethod::•<core::num*>();
+ self::NoSuchMethod<core::num> nsm = new self::NoSuchMethod::•<core::num>();
self::expect(3, nsm.{self::B::method}(3));
}
static method expect(dynamic expected, dynamic actual) → dynamic {
diff --git a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.outline.expect b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.outline.expect
index 22cd762..1ce38f4 100644
--- a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.outline.expect
@@ -1,163 +1,84 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-typedef ContraFunction<contravariant T extends core::Object* = dynamic> = (T*) →* void;
-typedef InvFunction<invariant T extends core::Object* = dynamic> = (T*) →* T*;
-class Contravariant<contravariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Contravariant<self::Contravariant::T*>*
+typedef ContraFunction<contravariant T extends core::Object? = dynamic> = (T%) → void;
+typedef InvFunction<invariant T extends core::Object? = dynamic> = (T%) → T%;
+class Contravariant<contravariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Contravariant<self::Contravariant::T%>
;
- 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 Invariant<invariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Invariant<self::Invariant::T*>*
+class Invariant<invariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Invariant<self::Invariant::T%>
;
- 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 A<contravariant T extends core::Object* = dynamic, U extends core::Object* = dynamic, V extends core::Object* = dynamic> extends core::Object {
- final field (self::A::T*) →* void field;
- synthetic constructor •() → self::A<self::A::T*, self::A::U*, self::A::V*>*
+class A<contravariant T extends core::Object? = dynamic, U extends core::Object? = dynamic, V extends core::Object? = dynamic> extends core::Object {
+ final field (self::A::T%) →? void field;
+ synthetic constructor •() → self::A<self::A::T%, self::A::U%, self::A::V%>
;
- method method(self::A::T* t, (self::A::U*) →* void u, generic-covariant-impl self::A::V* v) → void
+ method method(self::A::T% t, (self::A::U%) → void u, generic-covariant-impl self::A::V% v) → void
;
- method method2(self::A::T* x, [self::A::T* y]) → void
+ method method2(self::A::T% x, [self::A::T? y]) → void
;
- set x(self::A::T* t) → void
+ set x(self::A::T% t) → void
;
- get mapContra() → core::Map<self::A::U*, self::Contravariant<self::A::V*>*>*
+ get mapContra() → core::Map<self::A::U%, self::Contravariant<self::A::V%>>
;
- get mapContraFn() → core::Map<self::A::U*, (self::A::V*) →* void>*
+ get mapContraFn() → core::Map<self::A::U%, (self::A::V%) → void>
;
- get mapInv() → core::Map<self::A::U*, self::Invariant<self::A::V*>*>*
+ get mapInv() → core::Map<self::A::U%, self::Invariant<self::A::V%>>
;
- get mapInvFn() → core::Map<self::A::U*, (self::A::V*) →* self::A::V*>*
+ get mapInvFn() → core::Map<self::A::U%, (self::A::V%) → self::A::V%>
;
- 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 B<invariant T extends core::Object* = dynamic> extends core::Object {
- field self::B::T* x;
- synthetic constructor •() → self::B<self::B::T*>*
+class B<invariant T extends core::Object? = dynamic> extends core::Object {
+ field self::B::T? x;
+ synthetic constructor •() → self::B<self::B::T%>
;
- method method(self::B::T* x) → self::B::T*
+ method method(self::B::T% x) → self::B::T%
;
- set y(self::B::T* x) → void
+ set y(self::B::T% x) → void
;
- abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
- 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 get runtimeType() → core::Type*; -> core::Object::runtimeType
}
-class C<contravariant T extends core::Object* = dynamic> extends core::Object {
- final field (self::C::T*) →* void field;
- synthetic constructor •() → self::C<self::C::T*>*
+class C<contravariant T extends core::Object? = dynamic> extends core::Object {
+ final field (self::C::T%) →? void field;
+ synthetic constructor •() → self::C<self::C::T%>
;
- method method(self::C::T* x, [self::C::T* y]) → void
+ method method(self::C::T% x, [self::C::T? y]) → void
;
- set x(self::C::T* t) → void
+ set x(self::C::T% t) → 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 D<T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::D<self::D::T*>*
+abstract class D<T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::D<self::D::T%>
;
- abstract method method(generic-covariant-impl self::D::T* x) → core::int*;
- 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 method method(generic-covariant-impl self::D::T% x) → core::int;
}
-class E<invariant T extends core::Object* = dynamic> extends core::Object {
- final field (self::E::T*) →* void f;
- constructor •((self::E::T*) →* void f) → self::E<self::E::T*>*
+class E<invariant T extends core::Object? = dynamic> extends core::Object {
+ final field (self::E::T%) → void f;
+ constructor •((self::E::T%) → void f) → self::E<self::E::T%>
;
- method method(self::E::T* x) → core::int*
+ method method(self::E::T% x) → core::int
;
- 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 F<invariant T extends core::Object* = dynamic> extends self::E<self::F::T*> implements self::D<self::F::T*> {
- constructor •((self::F::T*) →* void f) → self::F<self::F::T*>*
+class F<invariant T extends core::Object? = dynamic> extends self::E<self::F::T%> implements self::D<self::F::T%> {
+ constructor •((self::F::T%) → void f) → self::F<self::F::T%>
;
- forwarding-stub method method(generic-covariant-impl self::F::T* x) → core::int*
+ forwarding-stub method method(generic-covariant-impl self::F::T% x) → core::int
return super.{self::E::method}(x);
}
-class NoSuchMethod<invariant T extends core::Object* = dynamic> extends core::Object implements self::B<self::NoSuchMethod::T*> {
- synthetic constructor •() → self::NoSuchMethod<self::NoSuchMethod::T*>*
+class NoSuchMethod<invariant T extends core::Object? = dynamic> extends core::Object implements self::B<self::NoSuchMethod::T%> {
+ synthetic constructor •() → self::NoSuchMethod<self::NoSuchMethod::T%>
;
- method noSuchMethod(core::Invocation* _) → dynamic
+ method noSuchMethod(core::Invocation _) → dynamic
;
- 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 get runtimeType() → core::Type*; -> core::Object::runtimeType
- no-such-method-forwarder get x() → self::NoSuchMethod::T*
- return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#x, 1, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} self::NoSuchMethod::T*;
- no-such-method-forwarder method method(self::NoSuchMethod::T* x) → self::NoSuchMethod::T*
- return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#method, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} self::NoSuchMethod::T*;
- no-such-method-forwarder set y(self::NoSuchMethod::T* x) → void
+ no-such-method-forwarder get x() → self::NoSuchMethod::T?
+ return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#x, 1, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic,ForNonNullableByDefault} self::NoSuchMethod::T?;
+ no-such-method-forwarder method method(self::NoSuchMethod::T% x) → self::NoSuchMethod::T%
+ return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#method, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic,ForNonNullableByDefault} self::NoSuchMethod::T%;
+ no-such-method-forwarder set y(self::NoSuchMethod::T% x) → void
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#y=, 2, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{})));
- no-such-method-forwarder set x(self::NoSuchMethod::T* value) → void
+ no-such-method-forwarder set x(self::NoSuchMethod::T? value) → void
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#x=, 2, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{})));
}
static method main() → dynamic
@@ -167,17 +88,17 @@
Extra constant evaluation status:
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:5 -> SymbolConstant(#x)
-Evaluated: ListLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:5 -> ListConstant(const <Type*>[])
-Evaluated: ListLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:5 -> ListConstant(const <dynamic>[])
-Evaluated: MapLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:5 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:6 -> SymbolConstant(#x)
+Evaluated: ListLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:6 -> ListConstant(const <Type*>[])
+Evaluated: ListLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:6 -> ListConstant(const <dynamic>[])
+Evaluated: MapLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:6 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
Evaluated: SymbolLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:23:5 -> SymbolConstant(#method)
Evaluated: ListLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:23:5 -> ListConstant(const <Type*>[])
Evaluated: MapLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:23:5 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
Evaluated: SymbolLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:24:12 -> SymbolConstant(#y=)
Evaluated: ListLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:24:12 -> ListConstant(const <Type*>[])
Evaluated: MapLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:24:12 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
-Evaluated: SymbolLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:5 -> SymbolConstant(#x=)
-Evaluated: ListLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:5 -> ListConstant(const <Type*>[])
-Evaluated: MapLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:5 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
+Evaluated: SymbolLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:6 -> SymbolConstant(#x=)
+Evaluated: ListLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:6 -> ListConstant(const <Type*>[])
+Evaluated: MapLiteral @ org-dartlang-testcase:///generic_covariance_sound_variance.dart:22:6 -> InstanceConstant(const _ImmutableMap<Symbol*, dynamic>{_ImmutableMap._kvPairs: const <dynamic>[]})
Extra constant evaluation: evaluated: 42, effectively constant: 13
diff --git a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.transformed.expect b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.transformed.expect
index 8f2b714..3719b77 100644
--- a/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/variance/generic_covariance_sound_variance.dart.weak.transformed.expect
@@ -1,191 +1,113 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-typedef ContraFunction<contravariant T extends core::Object* = dynamic> = (T*) →* void;
-typedef InvFunction<invariant T extends core::Object* = dynamic> = (T*) →* T*;
-class Contravariant<contravariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Contravariant<self::Contravariant::T*>*
+typedef ContraFunction<contravariant T extends core::Object? = dynamic> = (T%) → void;
+typedef InvFunction<invariant T extends core::Object? = dynamic> = (T%) → T%;
+class Contravariant<contravariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Contravariant<self::Contravariant::T%>
: super core::Object::•()
;
- 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 Invariant<invariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Invariant<self::Invariant::T*>*
+class Invariant<invariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Invariant<self::Invariant::T%>
: super core::Object::•()
;
- 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 A<contravariant T extends core::Object* = dynamic, U extends core::Object* = dynamic, V extends core::Object* = dynamic> extends core::Object {
- final field (self::A::T*) →* void field = null;
- synthetic constructor •() → self::A<self::A::T*, self::A::U*, self::A::V*>*
+class A<contravariant T extends core::Object? = dynamic, U extends core::Object? = dynamic, V extends core::Object? = dynamic> extends core::Object {
+ final field (self::A::T%) →? void field = null;
+ synthetic constructor •() → self::A<self::A::T%, self::A::U%, self::A::V%>
: super core::Object::•()
;
- method method(self::A::T* t, (self::A::U*) →* void u, generic-covariant-impl self::A::V* v) → void {}
- method method2(self::A::T* x, [self::A::T* y = #C1]) → void {}
- set x(self::A::T* t) → void {}
- get mapContra() → core::Map<self::A::U*, self::Contravariant<self::A::V*>*>*
- return core::Map::•<self::A::U*, self::Contravariant<self::A::V*>*>();
- get mapContraFn() → core::Map<self::A::U*, (self::A::V*) →* void>*
- return core::Map::•<self::A::U*, (self::A::V*) →* void>();
- get mapInv() → core::Map<self::A::U*, self::Invariant<self::A::V*>*>*
- return core::Map::•<self::A::U*, self::Invariant<self::A::V*>*>();
- get mapInvFn() → core::Map<self::A::U*, (self::A::V*) →* self::A::V*>*
- return core::Map::•<self::A::U*, (self::A::V*) →* self::A::V*>();
- 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(self::A::T% t, (self::A::U%) → void u, generic-covariant-impl self::A::V% v) → void {}
+ method method2(self::A::T% x, [self::A::T? y = #C1]) → void {}
+ set x(self::A::T% t) → void {}
+ get mapContra() → core::Map<self::A::U%, self::Contravariant<self::A::V%>>
+ return core::Map::•<self::A::U%, self::Contravariant<self::A::V%>>();
+ get mapContraFn() → core::Map<self::A::U%, (self::A::V%) → void>
+ return core::Map::•<self::A::U%, (self::A::V%) → void>();
+ get mapInv() → core::Map<self::A::U%, self::Invariant<self::A::V%>>
+ return core::Map::•<self::A::U%, self::Invariant<self::A::V%>>();
+ get mapInvFn() → core::Map<self::A::U%, (self::A::V%) → self::A::V%>
+ return core::Map::•<self::A::U%, (self::A::V%) → self::A::V%>();
}
-class B<invariant T extends core::Object* = dynamic> extends core::Object {
- field self::B::T* x = null;
- synthetic constructor •() → self::B<self::B::T*>*
+class B<invariant T extends core::Object? = dynamic> extends core::Object {
+ field self::B::T? x = null;
+ synthetic constructor •() → self::B<self::B::T%>
: super core::Object::•()
;
- method method(self::B::T* x) → self::B::T*
+ method method(self::B::T% x) → self::B::T%
return x;
- set y(self::B::T* x) → void {}
- abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
- 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 get runtimeType() → core::Type*; -> core::Object::runtimeType
+ set y(self::B::T% x) → void {}
}
-class C<contravariant T extends core::Object* = dynamic> extends core::Object {
- final field (self::C::T*) →* void field = null;
- synthetic constructor •() → self::C<self::C::T*>*
+class C<contravariant T extends core::Object? = dynamic> extends core::Object {
+ final field (self::C::T%) →? void field = null;
+ synthetic constructor •() → self::C<self::C::T%>
: super core::Object::•()
;
- method method(self::C::T* x, [self::C::T* y = #C1]) → void {}
- set x(self::C::T* t) → 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(self::C::T% x, [self::C::T? y = #C1]) → void {}
+ set x(self::C::T% t) → void {}
}
-abstract class D<T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::D<self::D::T*>*
+abstract class D<T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::D<self::D::T%>
: super core::Object::•()
;
- abstract method method(generic-covariant-impl self::D::T* x) → core::int*;
- 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 method method(generic-covariant-impl self::D::T% x) → core::int;
}
-class E<invariant T extends core::Object* = dynamic> extends core::Object {
- final field (self::E::T*) →* void f;
- constructor •((self::E::T*) →* void f) → self::E<self::E::T*>*
+class E<invariant T extends core::Object? = dynamic> extends core::Object {
+ final field (self::E::T%) → void f;
+ constructor •((self::E::T%) → void f) → self::E<self::E::T%>
: self::E::f = f, super core::Object::•()
;
- method method(self::E::T* x) → core::int* {
- let final self::E::T* #t1 = x in this.{self::E::f}.call(#t1);
+ method method(self::E::T% x) → core::int {
+ let final self::E::T% #t1 = x in this.{self::E::f}.call(#t1);
+ return 0;
}
- 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 F<invariant T extends core::Object* = dynamic> extends self::E<self::F::T*> implements self::D<self::F::T*> {
- constructor •((self::F::T*) →* void f) → self::F<self::F::T*>*
+class F<invariant T extends core::Object? = dynamic> extends self::E<self::F::T%> implements self::D<self::F::T%> {
+ constructor •((self::F::T%) → void f) → self::F<self::F::T%>
: super self::E::•(f)
;
- forwarding-stub method method(generic-covariant-impl self::F::T* x) → core::int*
+ forwarding-stub method method(generic-covariant-impl self::F::T% x) → core::int
return super.{self::E::method}(x);
}
-class NoSuchMethod<invariant T extends core::Object* = dynamic> extends core::Object implements self::B<self::NoSuchMethod::T*> {
- synthetic constructor •() → self::NoSuchMethod<self::NoSuchMethod::T*>*
+class NoSuchMethod<invariant T extends core::Object? = dynamic> extends core::Object implements self::B<self::NoSuchMethod::T%> {
+ synthetic constructor •() → self::NoSuchMethod<self::NoSuchMethod::T%>
: super core::Object::•()
;
- method noSuchMethod(core::Invocation* _) → dynamic
+ method noSuchMethod(core::Invocation _) → dynamic
return 3;
- 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 get runtimeType() → core::Type*; -> core::Object::runtimeType
- no-such-method-forwarder get x() → self::NoSuchMethod::T*
- return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic} self::NoSuchMethod::T*;
- no-such-method-forwarder method method(self::NoSuchMethod::T* x) → self::NoSuchMethod::T*
- return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, core::List::unmodifiable<dynamic>(core::_GrowableList::_literal1<dynamic>(x)), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic} self::NoSuchMethod::T*;
- no-such-method-forwarder set y(self::NoSuchMethod::T* x) → void
+ no-such-method-forwarder get x() → self::NoSuchMethod::T?
+ return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic,ForNonNullableByDefault} self::NoSuchMethod::T?;
+ no-such-method-forwarder method method(self::NoSuchMethod::T% x) → self::NoSuchMethod::T%
+ return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, core::List::unmodifiable<dynamic>(core::_GrowableList::_literal1<dynamic>(x)), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic,ForNonNullableByDefault} self::NoSuchMethod::T%;
+ no-such-method-forwarder set y(self::NoSuchMethod::T% x) → void
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 2, #C3, core::List::unmodifiable<dynamic>(core::_GrowableList::_literal1<dynamic>(x)), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5)));
- no-such-method-forwarder set x(self::NoSuchMethod::T* value) → void
+ no-such-method-forwarder set x(self::NoSuchMethod::T? value) → void
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 2, #C3, core::List::unmodifiable<dynamic>(core::_GrowableList::_literal1<dynamic>(value)), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5)));
}
static method main() → dynamic {
- self::A<core::int*, core::num*, core::String*>* a = new self::A::•<core::int*, core::num*, core::String*>();
+ self::A<core::int, core::num, core::String> a = new self::A::•<core::int, core::num, core::String>();
self::expect(null, a.{self::A::field});
- a.{self::A::method}(3, (core::num* num) → Null {}, "test");
+ a.{self::A::method}(3, (core::num num) → void {}, "test");
a.{self::A::method2}(3);
a.{self::A::x} = 3;
- core::Map<core::num*, self::Contravariant<core::String*>*>* mapContra = a.{self::A::mapContra} as{TypeError,CovarianceCheck} core::Map<core::num*, self::Contravariant<core::String*>*>*;
- core::Map<core::num*, (core::String*) →* void>* mapContraFn = a.{self::A::mapContraFn} as{TypeError,CovarianceCheck} core::Map<core::num*, (core::String*) →* void>*;
- core::Map<core::num*, self::Invariant<core::String*>*>* mapInv = a.{self::A::mapInv} as{TypeError,CovarianceCheck} core::Map<core::num*, self::Invariant<core::String*>*>*;
- core::Map<core::num*, (core::String*) →* core::String*>* mapInvFn = a.{self::A::mapInvFn} as{TypeError,CovarianceCheck} core::Map<core::num*, (core::String*) →* core::String*>*;
- self::B<core::int*>* b = new self::B::•<core::int*>();
+ core::Map<core::num, self::Contravariant<core::String>> mapContra = a.{self::A::mapContra} as{TypeError,CovarianceCheck,ForNonNullableByDefault} core::Map<core::num, self::Contravariant<core::String>>;
+ core::Map<core::num, (core::String) → void> mapContraFn = a.{self::A::mapContraFn} as{TypeError,CovarianceCheck,ForNonNullableByDefault} core::Map<core::num, (core::String) → void>;
+ core::Map<core::num, self::Invariant<core::String>> mapInv = a.{self::A::mapInv} as{TypeError,CovarianceCheck,ForNonNullableByDefault} core::Map<core::num, self::Invariant<core::String>>;
+ core::Map<core::num, (core::String) → core::String> mapInvFn = a.{self::A::mapInvFn} as{TypeError,CovarianceCheck,ForNonNullableByDefault} core::Map<core::num, (core::String) → core::String>;
+ self::B<core::int> b = new self::B::•<core::int>();
b.{self::B::x} = 3;
self::expect(3, b.{self::B::x});
self::expect(3, b.{self::B::method}(3));
b.{self::B::y} = 3;
- self::C<core::int*>* c = new self::C::•<core::int*>();
+ self::C<core::int> c = new self::C::•<core::int>();
self::expect(null, c.{self::C::field});
c.{self::C::method}(3, 2);
c.{self::C::x} = 3;
- self::D<core::Object*>* d = new self::F::•<core::String*>((core::String* s) → Null {});
+ self::D<core::Object> d = new self::F::•<core::String>((core::String s) → void {});
d.{self::D::method}("test");
- self::NoSuchMethod<core::num*>* nsm = new self::NoSuchMethod::•<core::num*>();
+ self::NoSuchMethod<core::num> nsm = new self::NoSuchMethod::•<core::num>();
self::expect(3, nsm.{self::B::method}(3));
}
static method expect(dynamic expected, dynamic actual) → dynamic {
diff --git a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart
index ec067aa..2aefefb 100644
--- a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart
+++ b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// 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.9
+
class A {}
mixin B<inout X, out Y, in Z> on A {}
diff --git a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.textual_outline.expect b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.textual_outline.expect
index a4e2429..dd52422 100644
--- a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.textual_outline.expect
@@ -1,4 +1,3 @@
-// @dart = 2.9
class A {}
mixin B<inout X, out Y, in Z> on A {}
main() {}
diff --git a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.expect b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.expect
index c1ffa9b..abd3eea 100644
--- a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.expect
+++ b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.expect
@@ -1,22 +1,12 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class A extends core::Object {
- synthetic constructor •() → self::A*
+ synthetic constructor •() → self::A
: super core::Object::•()
;
- 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 B<invariant X extends core::Object* = dynamic, Y extends core::Object* = dynamic, contravariant Z extends core::Object* = dynamic> extends self::A /*isMixinDeclaration*/ {
+abstract class B<invariant X extends core::Object? = dynamic, Y extends core::Object? = dynamic, contravariant Z extends core::Object? = dynamic> extends self::A /*isMixinDeclaration*/ {
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.outline.expect b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.outline.expect
index 65ebf5c..60dc231 100644
--- a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.outline.expect
@@ -1,22 +1,12 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class A extends core::Object {
- synthetic constructor •() → self::A*
+ synthetic constructor •() → self::A
;
- 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 B<invariant X extends core::Object* = dynamic, Y extends core::Object* = dynamic, contravariant Z extends core::Object* = dynamic> extends self::A /*isMixinDeclaration*/ {
+abstract class B<invariant X extends core::Object? = dynamic, Y extends core::Object? = dynamic, contravariant Z extends core::Object? = dynamic> extends self::A /*isMixinDeclaration*/ {
}
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.transformed.expect b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.transformed.expect
index c1ffa9b..abd3eea 100644
--- a/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/variance/mixin_type_parameter_modifier.dart.weak.transformed.expect
@@ -1,22 +1,12 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class A extends core::Object {
- synthetic constructor •() → self::A*
+ synthetic constructor •() → self::A
: super core::Object::•()
;
- 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 B<invariant X extends core::Object* = dynamic, Y extends core::Object* = dynamic, contravariant Z extends core::Object* = dynamic> extends self::A /*isMixinDeclaration*/ {
+abstract class B<invariant X extends core::Object? = dynamic, Y extends core::Object? = dynamic, contravariant Z extends core::Object? = dynamic> extends self::A /*isMixinDeclaration*/ {
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/variance/unconstrained_inference.dart b/pkg/front_end/testcases/variance/unconstrained_inference.dart
index fa68fbe..7f68e00 100644
--- a/pkg/front_end/testcases/variance/unconstrained_inference.dart
+++ b/pkg/front_end/testcases/variance/unconstrained_inference.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// 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.9
+
class Covariant<out T> {}
class Contravariant<in T> {}
class Invariant<inout T> {}
diff --git a/pkg/front_end/testcases/variance/unconstrained_inference.dart.textual_outline.expect b/pkg/front_end/testcases/variance/unconstrained_inference.dart.textual_outline.expect
index 8440fa0..0d3c633 100644
--- a/pkg/front_end/testcases/variance/unconstrained_inference.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/variance/unconstrained_inference.dart.textual_outline.expect
@@ -1,4 +1,3 @@
-// @dart = 2.9
class Covariant<out T> {}
class Contravariant<in T> {}
class Invariant<inout T> {}
diff --git a/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.expect b/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.expect
index d9a2571..0850650 100644
--- a/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.expect
+++ b/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.expect
@@ -1,60 +1,30 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-class Covariant<T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Covariant<self::Covariant::T*>*
+class Covariant<T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Covariant<self::Covariant::T%>
: super core::Object::•()
;
- 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 Contravariant<contravariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Contravariant<self::Contravariant::T*>*
+class Contravariant<contravariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Contravariant<self::Contravariant::T%>
: super core::Object::•()
;
- 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 Invariant<invariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Invariant<self::Invariant::T*>*
+class Invariant<invariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Invariant<self::Invariant::T%>
: super core::Object::•()
;
- 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
}
-static method covariantListInfer<T extends core::Object* = dynamic>(self::Covariant<core::List<self::covariantListInfer::T*>*>* x) → void {}
-static method contravariantListInfer<T extends core::Object* = dynamic>(self::Contravariant<core::List<self::contravariantListInfer::T*>*>* x) → void {}
-static method invariantListInfer<T extends core::Object* = dynamic>(self::Invariant<core::List<self::invariantListInfer::T*>*>* x) → void {}
+static method covariantListInfer<T extends core::Object? = dynamic>(self::Covariant<core::List<self::covariantListInfer::T%>> x) → void {}
+static method contravariantListInfer<T extends core::Object? = dynamic>(self::Contravariant<core::List<self::contravariantListInfer::T%>> x) → void {}
+static method invariantListInfer<T extends core::Object? = dynamic>(self::Invariant<core::List<self::invariantListInfer::T%>> x) → void {}
static method main() → dynamic {
- self::Covariant<dynamic>* cov = new self::Covariant::•<dynamic>();
- self::covariantListInfer<dynamic>(new self::Covariant::•<core::List<dynamic>*>());
- self::Contravariant<Null>* contra = new self::Contravariant::•<Null>();
- self::contravariantListInfer<Null>(new self::Contravariant::•<core::List<Null>*>());
- self::Invariant<dynamic>* inv = new self::Invariant::•<dynamic>();
- self::invariantListInfer<Null>(new self::Invariant::•<core::List<Null>*>());
+ self::Covariant<dynamic> cov = new self::Covariant::•<dynamic>();
+ self::covariantListInfer<core::Object?>(new self::Covariant::•<core::List<core::Object?>>());
+ self::Contravariant<Never> contra = new self::Contravariant::•<Never>();
+ self::contravariantListInfer<core::Object?>(new self::Contravariant::•<core::List<core::Object?>>());
+ self::Invariant<dynamic> inv = new self::Invariant::•<dynamic>();
+ self::invariantListInfer<core::Object?>(new self::Invariant::•<core::List<core::Object?>>());
}
diff --git a/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.outline.expect b/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.outline.expect
index 80e78fe..c5c73b9 100644
--- a/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.outline.expect
@@ -1,54 +1,24 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-class Covariant<T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Covariant<self::Covariant::T*>*
+class Covariant<T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Covariant<self::Covariant::T%>
;
- 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 Contravariant<contravariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Contravariant<self::Contravariant::T*>*
+class Contravariant<contravariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Contravariant<self::Contravariant::T%>
;
- 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 Invariant<invariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Invariant<self::Invariant::T*>*
+class Invariant<invariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Invariant<self::Invariant::T%>
;
- 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
}
-static method covariantListInfer<T extends core::Object* = dynamic>(self::Covariant<core::List<self::covariantListInfer::T*>*>* x) → void
+static method covariantListInfer<T extends core::Object? = dynamic>(self::Covariant<core::List<self::covariantListInfer::T%>> x) → void
;
-static method contravariantListInfer<T extends core::Object* = dynamic>(self::Contravariant<core::List<self::contravariantListInfer::T*>*>* x) → void
+static method contravariantListInfer<T extends core::Object? = dynamic>(self::Contravariant<core::List<self::contravariantListInfer::T%>> x) → void
;
-static method invariantListInfer<T extends core::Object* = dynamic>(self::Invariant<core::List<self::invariantListInfer::T*>*>* x) → void
+static method invariantListInfer<T extends core::Object? = dynamic>(self::Invariant<core::List<self::invariantListInfer::T%>> x) → void
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.transformed.expect b/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.transformed.expect
index d9a2571..0850650 100644
--- a/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/variance/unconstrained_inference.dart.weak.transformed.expect
@@ -1,60 +1,30 @@
-library;
+library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-class Covariant<T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Covariant<self::Covariant::T*>*
+class Covariant<T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Covariant<self::Covariant::T%>
: super core::Object::•()
;
- 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 Contravariant<contravariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Contravariant<self::Contravariant::T*>*
+class Contravariant<contravariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Contravariant<self::Contravariant::T%>
: super core::Object::•()
;
- 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 Invariant<invariant T extends core::Object* = dynamic> extends core::Object {
- synthetic constructor •() → self::Invariant<self::Invariant::T*>*
+class Invariant<invariant T extends core::Object? = dynamic> extends core::Object {
+ synthetic constructor •() → self::Invariant<self::Invariant::T%>
: super core::Object::•()
;
- 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
}
-static method covariantListInfer<T extends core::Object* = dynamic>(self::Covariant<core::List<self::covariantListInfer::T*>*>* x) → void {}
-static method contravariantListInfer<T extends core::Object* = dynamic>(self::Contravariant<core::List<self::contravariantListInfer::T*>*>* x) → void {}
-static method invariantListInfer<T extends core::Object* = dynamic>(self::Invariant<core::List<self::invariantListInfer::T*>*>* x) → void {}
+static method covariantListInfer<T extends core::Object? = dynamic>(self::Covariant<core::List<self::covariantListInfer::T%>> x) → void {}
+static method contravariantListInfer<T extends core::Object? = dynamic>(self::Contravariant<core::List<self::contravariantListInfer::T%>> x) → void {}
+static method invariantListInfer<T extends core::Object? = dynamic>(self::Invariant<core::List<self::invariantListInfer::T%>> x) → void {}
static method main() → dynamic {
- self::Covariant<dynamic>* cov = new self::Covariant::•<dynamic>();
- self::covariantListInfer<dynamic>(new self::Covariant::•<core::List<dynamic>*>());
- self::Contravariant<Null>* contra = new self::Contravariant::•<Null>();
- self::contravariantListInfer<Null>(new self::Contravariant::•<core::List<Null>*>());
- self::Invariant<dynamic>* inv = new self::Invariant::•<dynamic>();
- self::invariantListInfer<Null>(new self::Invariant::•<core::List<Null>*>());
+ self::Covariant<dynamic> cov = new self::Covariant::•<dynamic>();
+ self::covariantListInfer<core::Object?>(new self::Covariant::•<core::List<core::Object?>>());
+ self::Contravariant<Never> contra = new self::Contravariant::•<Never>();
+ self::contravariantListInfer<core::Object?>(new self::Contravariant::•<core::List<core::Object?>>());
+ self::Invariant<dynamic> inv = new self::Invariant::•<dynamic>();
+ self::invariantListInfer<core::Object?>(new self::Invariant::•<core::List<core::Object?>>());
}
diff --git a/pkg/front_end/testcases/weak.status b/pkg/front_end/testcases/weak.status
index 0202847..d4a488a 100644
--- a/pkg/front_end/testcases/weak.status
+++ b/pkg/front_end/testcases/weak.status
@@ -70,6 +70,7 @@
general/error_recovery/yield_not_in_generator: RuntimeError
general/expressions: RuntimeError
general/external_import: RuntimeError # The native extension to import doesn't exist. This is ok.
+general/function_invocation_bounds: TypeCheckError
general/getter_vs_setter_type: TypeCheckError
general/incomplete_field_formal_parameter: RuntimeError
general/infer_field_from_multiple: TypeCheckError
diff --git a/pkg/kernel/lib/canonical_name.dart b/pkg/kernel/lib/canonical_name.dart
index ea7f4fb..086aa2a 100644
--- a/pkg/kernel/lib/canonical_name.dart
+++ b/pkg/kernel/lib/canonical_name.dart
@@ -207,7 +207,20 @@
}
if (_reference == target) return;
if (_reference != null) {
- throw '$this is already bound';
+ StringBuffer sb = new StringBuffer();
+ sb.write('$this is already bound to ${_reference}');
+ if (_reference?._node != null) {
+ sb.write(' with node ${_reference?._node}'
+ ' (${_reference?._node.runtimeType}'
+ ':${_reference?._node.hashCode})');
+ }
+ sb.write(', trying to bind to ${target}');
+ if (target._node != null) {
+ sb.write(' with node ${target._node}'
+ ' (${target._node.runtimeType}'
+ ':${target._node.hashCode})');
+ }
+ throw sb.toString();
}
if (target.canonicalName != null) {
throw 'Cannot bind $this to ${target.node}, target is already bound to '
diff --git a/pkg/kernel/lib/transformations/type_casts_optimizer.dart b/pkg/kernel/lib/transformations/type_casts_optimizer.dart
index 4df790f..3ddbb77 100644
--- a/pkg/kernel/lib/transformations/type_casts_optimizer.dart
+++ b/pkg/kernel/lib/transformations/type_casts_optimizer.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:kernel/ast.dart';
+import 'package:kernel/core_types.dart' show CoreTypes;
import 'package:kernel/type_environment.dart'
show StaticTypeContext, SubtypeCheckMode, TypeEnvironment;
@@ -51,7 +52,7 @@
// operand).
bool isRedundantTypeCast(AsExpression node, DartType operandStaticType,
TypeEnvironment env, bool nullSafety) {
- if (!_canBeTransformed(node)) {
+ if (!_canBeTransformed(node, env.coreTypes)) {
return false;
}
@@ -68,7 +69,7 @@
// 'Let tmp = [node.operand] in (tmp == null) ? tmp as T : tmp'.
bool canBeReducedToNullCheckAndCast(AsExpression node,
DartType operandStaticType, TypeEnvironment env, bool nullSafety) {
- if (!_canBeTransformed(node)) {
+ if (!_canBeTransformed(node, env.coreTypes)) {
return false;
}
@@ -83,7 +84,7 @@
return false;
}
-bool _canBeTransformed(AsExpression node) {
+bool _canBeTransformed(AsExpression node, CoreTypes coreTypes) {
if (node.isCovarianceCheck) {
// Keep casts inserted by the front-end to ensure soundness of
// covariant types.
@@ -91,8 +92,10 @@
}
final DartType dst = node.type;
- if (dst is DynamicType || dst is InvalidType) {
- // Keep casts to dynamic as they have zero overhead but change
+ if (dst is DynamicType ||
+ dst is InvalidType ||
+ (dst is InterfaceType && dst.classNode == coreTypes.functionClass)) {
+ // Keep casts to dynamic and Function as they change
// the semantics of calls. Also keep invalid types.
return false;
}
diff --git a/pkg/nnbd_migration/lib/nnbd_migration.dart b/pkg/nnbd_migration/lib/nnbd_migration.dart
index a05c09f..6dd3991 100644
--- a/pkg/nnbd_migration/lib/nnbd_migration.dart
+++ b/pkg/nnbd_migration/lib/nnbd_migration.dart
@@ -18,6 +18,11 @@
/// Description of fixes that might be performed by nullability migration.
class NullabilityFixDescription {
+ /// A `.then((value) => ...)` suffix was added to an expression.
+ static const addThen = NullabilityFixDescription._(
+ appliedMessage: 'Added `.then` to adjust type of Future expression',
+ kind: NullabilityFixKind.addThen);
+
/// An import was added to the library.
static const addImport = NullabilityFixDescription._(
appliedMessage: 'Added import for use in migrated code',
@@ -266,6 +271,7 @@
/// An enumeration of the various kinds of nullability fixes.
enum NullabilityFixKind {
+ addThen,
addImport,
addLate,
addLateDueToHint,
diff --git a/pkg/nnbd_migration/lib/src/edit_plan.dart b/pkg/nnbd_migration/lib/src/edit_plan.dart
index c603225..bc70677 100644
--- a/pkg/nnbd_migration/lib/src/edit_plan.dart
+++ b/pkg/nnbd_migration/lib/src/edit_plan.dart
@@ -282,21 +282,31 @@
}
/// Creates a new edit plan that consists of executing [innerPlan], and then
+ /// appending the given text with postfix precedence. This could be used, for
+ /// example, to append a property access or method call.
+ ///
+ /// Optional argument [info] contains information about why the change was
+ /// made.
+ NodeProducingEditPlan addPostfix(NodeProducingEditPlan innerPlan, String text,
+ {AtomicEditInfo info}) {
+ assert(innerPlan.sourceNode is Expression);
+ return surround(innerPlan,
+ suffix: [AtomicEdit.insert(text, info: info)],
+ outerPrecedence: Precedence.postfix,
+ innerPrecedence: Precedence.postfix,
+ associative: true);
+ }
+
+ /// Creates a new edit plan that consists of executing [innerPlan], and then
/// appending the given postfix [operator]. This could be used, for example,
/// to add a null check.
///
/// Optional argument [info] contains information about why the change was
/// made.
NodeProducingEditPlan addUnaryPostfix(
- NodeProducingEditPlan innerPlan, TokenType operator,
- {AtomicEditInfo info}) {
- assert(innerPlan.sourceNode is Expression);
- return surround(innerPlan,
- suffix: [AtomicEdit.insert(operator.lexeme, info: info)],
- outerPrecedence: Precedence.postfix,
- innerPrecedence: Precedence.postfix,
- associative: true);
- }
+ NodeProducingEditPlan innerPlan, TokenType operator,
+ {AtomicEditInfo info}) =>
+ addPostfix(innerPlan, operator.lexeme, info: info);
/// Creates a new edit plan that consists of executing [innerPlan], and then
/// prepending the given prefix [operator].
diff --git a/pkg/nnbd_migration/lib/src/fix_aggregator.dart b/pkg/nnbd_migration/lib/src/fix_aggregator.dart
index 6e57d8d..60e779d 100644
--- a/pkg/nnbd_migration/lib/src/fix_aggregator.dart
+++ b/pkg/nnbd_migration/lib/src/fix_aggregator.dart
@@ -18,6 +18,28 @@
import 'package:nnbd_migration/src/fix_builder.dart';
import 'package:nnbd_migration/src/utilities/hint_utils.dart';
+/// Base class representing a change that might need to be made to an
+/// expression.
+abstract class ExpressionChange {
+ /// The type of the expression after the change is applied.
+ final DartType resultType;
+
+ ExpressionChange(this.resultType);
+
+ /// Description of the change.
+ NullabilityFixDescription get description;
+
+ /// Creates a [NodeProducingEditPlan] that applies the change to [innerPlan].
+ NodeProducingEditPlan applyExpression(FixAggregator aggregator,
+ NodeProducingEditPlan innerPlan, AtomicEditInfo info);
+
+ /// Creates a string that applies the change to the [inner] text string.
+ String applyText(FixAggregator aggregator, String inner);
+
+ /// Describes the change, for use in debugging.
+ String describe();
+}
+
/// Visitor that combines together the changes produced by [FixBuilder] into a
/// concrete set of source code edits using the infrastructure of [EditPlan].
class FixAggregator extends UnifyingAstVisitor<void> {
@@ -195,6 +217,64 @@
}
}
+/// [ExpressionChange] describing the addition of an `as` cast to an expression.
+class IntroduceAsChange extends ExpressionChange {
+ /// The type being cast to.
+ final DartType type;
+
+ /// Indicates whether this is a downcast.
+ final bool isDowncast;
+
+ IntroduceAsChange(this.type, {@required this.isDowncast}) : super(type);
+
+ @override
+ NullabilityFixDescription get description => isDowncast
+ ? NullabilityFixDescription.downcastExpression
+ : NullabilityFixDescription.otherCastExpression;
+
+ @override
+ NodeProducingEditPlan applyExpression(FixAggregator aggregator,
+ NodeProducingEditPlan innerPlan, AtomicEditInfo info) =>
+ aggregator.planner.addBinaryPostfix(
+ innerPlan, TokenType.AS, aggregator.typeToCode(type),
+ info: info);
+
+ @override
+ String applyText(FixAggregator aggregator, String inner) =>
+ '$inner as ${aggregator.typeToCode(type)}';
+
+ @override
+ String describe() => 'IntroduceAsChange($type)';
+}
+
+/// [ExpressionChange] describing the addition of an `as` cast to an expression
+/// having a Future type.
+class IntroduceThenChange extends ExpressionChange {
+ /// The change that should be made to the value the future completes with.
+ final ExpressionChange innerChange;
+
+ IntroduceThenChange(DartType resultType, this.innerChange)
+ : super(resultType);
+
+ @override
+ NullabilityFixDescription get description =>
+ NullabilityFixDescription.addThen;
+
+ @override
+ NodeProducingEditPlan applyExpression(FixAggregator aggregator,
+ NodeProducingEditPlan innerPlan, AtomicEditInfo info) =>
+ aggregator.planner.addPostfix(innerPlan,
+ '.then((value) => ${innerChange.applyText(aggregator, 'value')})',
+ info: info);
+
+ @override
+ String applyText(FixAggregator aggregator, String inner) =>
+ '$inner.then((value) => ${innerChange.applyText(aggregator, 'value')})';
+
+ @override
+ String describe() => 'IntroduceThenChange($innerChange)';
+}
+
/// Reasons that a variable declaration is to be made late.
enum LateAdditionReason {
/// It was inferred that the associated variable declaration is to be made
@@ -701,69 +781,25 @@
/// Implementation of [NodeChange] specialized for operating on [Expression]
/// nodes.
class NodeChangeForExpression<N extends Expression> extends NodeChange<N> {
- bool _addsNoValidMigration = false;
+ /// The list of [ExpressionChange] objects that should be applied to the
+ /// expression, in the order they should be applied.
+ final List<ExpressionChange> expressionChanges = [];
- AtomicEditInfo _addNoValidMigrationInfo;
-
- bool _addsNullCheck = false;
-
- AtomicEditInfo _addNullCheckInfo;
-
- HintComment _addNullCheckHint;
-
- DartType _introducesAsType;
-
- AtomicEditInfo _introduceAsInfo;
+ /// The list of [AtomicEditInfo] objects corresponding to each change in
+ /// [expressionChanges].
+ final List<AtomicEditInfo> expressionChangeInfos = [];
NodeChangeForExpression() : super._();
- /// Gets the info for any added "no valid migration" comment.
- AtomicEditInfo get addNoValidMigrationInfo => _addNoValidMigrationInfo;
-
- /// Gets the info for any added null check.
- AtomicEditInfo get addNullCheckInfo => _addNullCheckInfo;
-
- /// Indicates whether [addNoValidMigration] has been called.
- bool get addsNoValidMigration => _addsNoValidMigration;
-
- /// Indicates whether [addNullCheck] has been called.
- bool get addsNullCheck => _addsNullCheck;
-
- /// Gets the info for any introduced "as" cast
- AtomicEditInfo get introducesAsInfo => _introduceAsInfo;
-
- /// Gets the type for any introduced "as" cast, or `null` if no "as" cast is
- /// being introduced.
- DartType get introducesAsType => _introducesAsType;
-
@override
Iterable<String> get _toStringParts => [
- if (_addsNoValidMigration) 'addsNoValidMigration',
- if (_addsNullCheck) 'addsNullCheck',
- if (_introducesAsType != null) 'introducesAsType'
+ for (var expressionChange in expressionChanges)
+ expressionChange.describe()
];
- void addNoValidMigration(AtomicEditInfo info) {
- assert(!_addsNoValidMigration);
- _addsNoValidMigration = true;
- _addNoValidMigrationInfo = info;
- }
-
- /// Causes a null check to be added to this expression, with the given [info].
- void addNullCheck(AtomicEditInfo info, {HintComment hint}) {
- assert(!_addsNullCheck);
- _addsNullCheck = true;
- _addNullCheckInfo = info;
- _addNullCheckHint = hint;
- }
-
- /// Causes a cast to the given [type] to be added to this expression, with
- /// the given [info].
- void introduceAs(DartType type, AtomicEditInfo info) {
- assert(_introducesAsType == null);
- assert(type != null);
- _introducesAsType = type;
- _introduceAsInfo = info;
+ void addExpressionChange(ExpressionChange change, AtomicEditInfo info) {
+ expressionChanges.add(change);
+ expressionChangeInfos.add(info);
}
@override
@@ -778,25 +814,9 @@
NodeProducingEditPlan _applyExpression(
FixAggregator aggregator, NodeProducingEditPlan innerPlan) {
var plan = innerPlan;
- if (_addsNullCheck) {
- var hint = _addNullCheckHint;
- if (hint != null) {
- plan = aggregator.planner.acceptNullabilityOrNullCheckHint(plan, hint,
- info: _addNullCheckInfo);
- } else {
- plan = aggregator.planner
- .addUnaryPostfix(plan, TokenType.BANG, info: _addNullCheckInfo);
- }
- }
- if (_addsNoValidMigration) {
- plan = aggregator.planner.addCommentPostfix(
- plan, '/* no valid migration */',
- info: _addNoValidMigrationInfo, isInformative: true);
- }
- if (_introducesAsType != null) {
- plan = aggregator.planner.addBinaryPostfix(
- plan, TokenType.AS, aggregator.typeToCode(_introducesAsType),
- info: _introduceAsInfo);
+ for (int i = 0; i < expressionChanges.length; i++) {
+ plan = expressionChanges[i]
+ .applyExpression(aggregator, plan, expressionChangeInfos[i]);
}
return plan;
}
@@ -1289,6 +1309,60 @@
}
}
+/// [ExpressionChange] describing the addition of a comment explaining that a
+/// literal `null` could not be migrated.
+class NoValidMigrationChange extends ExpressionChange {
+ NoValidMigrationChange(DartType resultType) : super(resultType);
+
+ @override
+ NullabilityFixDescription get description =>
+ NullabilityFixDescription.noValidMigrationForNull;
+
+ @override
+ NodeProducingEditPlan applyExpression(FixAggregator aggregator,
+ NodeProducingEditPlan innerPlan, AtomicEditInfo info) =>
+ aggregator.planner.addCommentPostfix(
+ innerPlan, '/* no valid migration */',
+ info: info, isInformative: true);
+
+ @override
+ String applyText(FixAggregator aggregator, String inner) =>
+ '$inner /* no valid migration */';
+
+ @override
+ String describe() => 'NoValidMigrationChange';
+}
+
+/// [ExpressionChange] describing the addition of an `!` after an expression.
+class NullCheckChange extends ExpressionChange {
+ /// The hint that is causing this `!` to be added, if any.
+ final HintComment hint;
+
+ NullCheckChange(DartType resultType, {this.hint}) : super(resultType);
+
+ @override
+ NullabilityFixDescription get description =>
+ NullabilityFixDescription.checkExpression;
+
+ @override
+ NodeProducingEditPlan applyExpression(FixAggregator aggregator,
+ NodeProducingEditPlan innerPlan, AtomicEditInfo info) {
+ if (hint != null) {
+ return aggregator.planner
+ .acceptNullabilityOrNullCheckHint(innerPlan, hint, info: info);
+ } else {
+ return aggregator.planner
+ .addUnaryPostfix(innerPlan, TokenType.BANG, info: info);
+ }
+ }
+
+ @override
+ String applyText(FixAggregator aggregator, String inner) => '$inner!';
+
+ @override
+ String describe() => 'NullCheckChange';
+}
+
/// Visitor that creates an appropriate [NodeChange] object for the node being
/// visited.
class _NodeChangeVisitor extends GeneralizingAstVisitor<NodeChange<AstNode>> {
diff --git a/pkg/nnbd_migration/lib/src/fix_builder.dart b/pkg/nnbd_migration/lib/src/fix_builder.dart
index 0f2cd7f..5575d97 100644
--- a/pkg/nnbd_migration/lib/src/fix_builder.dart
+++ b/pkg/nnbd_migration/lib/src/fix_builder.dart
@@ -577,44 +577,62 @@
_flowAnalysis = flowAnalysis;
}
- DartType _addCast(
+ DartType _addCastOrNullCheck(
Expression node, DartType expressionType, DartType contextType) {
- var isDowncast =
- _fixBuilder._typeSystem.isSubtypeOf(contextType, expressionType);
var checks =
_fixBuilder._variables.expressionChecks(_fixBuilder.source, node);
- var info = AtomicEditInfo(
- isDowncast
- ? NullabilityFixDescription.downcastExpression
- : NullabilityFixDescription.otherCastExpression,
- checks != null ? checks.edges : {});
+ var change = _createExpressionChange(node, expressionType, contextType);
+ var info = AtomicEditInfo(change.description, checks?.edges ?? {});
(_fixBuilder._getChange(node) as NodeChangeForExpression)
- .introduceAs(contextType, info);
- _flowAnalysis.asExpression_end(node, contextType);
- return contextType;
+ .addExpressionChange(change, info);
+ return change.resultType;
}
DartType _addNullCheck(Expression node, DartType type,
{AtomicEditInfo info, HintComment hint}) {
+ var change = _createNullCheckChange(node, type, hint: hint);
var checks =
_fixBuilder._variables.expressionChecks(_fixBuilder.source, node);
- bool noValidMigration = node is NullLiteral && hint == null;
- info ??= checks != null
- ? AtomicEditInfo(
- noValidMigration
- ? NullabilityFixDescription.noValidMigrationForNull
- : NullabilityFixDescription.checkExpression,
- checks.edges)
- : null;
+ info ??= AtomicEditInfo(change.description, checks?.edges ?? {});
var nodeChangeForExpression =
_fixBuilder._getChange(node) as NodeChangeForExpression;
- if (noValidMigration) {
- nodeChangeForExpression.addNoValidMigration(info);
- } else {
- nodeChangeForExpression.addNullCheck(info, hint: hint);
+ nodeChangeForExpression.addExpressionChange(change, info);
+ return change.resultType;
+ }
+
+ ExpressionChange _createExpressionChange(
+ Expression node, DartType expressionType, DartType contextType) {
+ var expressionFutureTypeArgument = _getFutureTypeArgument(expressionType);
+ var contextFutureTypeArgument = _getFutureTypeArgument(contextType);
+ if (expressionFutureTypeArgument != null &&
+ contextFutureTypeArgument != null) {
+ return IntroduceThenChange(
+ contextType,
+ _createExpressionChange(
+ node, expressionFutureTypeArgument, contextFutureTypeArgument));
}
+ // Either a cast or a null check is needed. We prefer to do a null
+ // check if we can.
+ var nonNullType = _fixBuilder._typeSystem.promoteToNonNull(expressionType);
+ if (_fixBuilder._typeSystem.isSubtypeOf(nonNullType, contextType)) {
+ return _createNullCheckChange(node, expressionType);
+ } else {
+ if (node != null) {
+ _flowAnalysis.asExpression_end(node, contextType);
+ }
+ return IntroduceAsChange(contextType,
+ isDowncast:
+ _fixBuilder._typeSystem.isSubtypeOf(contextType, expressionType));
+ }
+ }
+
+ ExpressionChange _createNullCheckChange(Expression node, DartType type,
+ {HintComment hint}) {
+ var resultType = _fixBuilder._typeSystem.promoteToNonNull(type as TypeImpl);
_flowAnalysis.nonNullAssert_end(node);
- return _fixBuilder._typeSystem.promoteToNonNull(type as TypeImpl);
+ return node is NullLiteral && hint == null
+ ? NoValidMigrationChange(resultType)
+ : NullCheckChange(resultType, hint: hint);
}
Expression _findNullabilityContextAncestor(Expression node) {
@@ -638,6 +656,16 @@
return finalType as InterfaceType;
}
+ DartType _getFutureTypeArgument(DartType type) {
+ if (type is InterfaceType && type.isDartAsyncFuture) {
+ var typeArguments = type.typeArguments;
+ if (typeArguments.isNotEmpty) {
+ return typeArguments.first;
+ }
+ }
+ return null;
+ }
+
DartType _modifyRValueType(Expression node, DartType type,
{DartType context}) {
if (node is MethodInvocation) {
@@ -689,14 +717,7 @@
.makeNullable(methodInvocationType as TypeImpl);
return type;
}
- // Either a cast or a null check is needed. We prefer to do a null
- // check if we can.
- var nonNullType = _fixBuilder._typeSystem.promoteToNonNull(type);
- if (_fixBuilder._typeSystem.isSubtypeOf(nonNullType, context)) {
- return _addNullCheck(node, type);
- } else {
- return _addCast(node, type, context);
- }
+ return _addCastOrNullCheck(node, type, context);
}
if (!_fixBuilder._typeSystem.isNullable(type)) return type;
if (_needsNullCheckDueToStructure(ancestor)) {
diff --git a/pkg/nnbd_migration/lib/src/front_end/info_builder.dart b/pkg/nnbd_migration/lib/src/front_end/info_builder.dart
index 7852c1d..39c2926 100644
--- a/pkg/nnbd_migration/lib/src/front_end/info_builder.dart
+++ b/pkg/nnbd_migration/lib/src/front_end/info_builder.dart
@@ -262,6 +262,9 @@
// We don't offer any edits around unmigratable `null`s. The user has
// to fix manually.
break;
+ case NullabilityFixKind.addThen:
+ // We don't offer any edits around addition of `.then` to a future.
+ break;
}
return edits;
}
diff --git a/pkg/nnbd_migration/lib/src/front_end/migration_summary.dart b/pkg/nnbd_migration/lib/src/front_end/migration_summary.dart
index a551df2..e8e39e1 100644
--- a/pkg/nnbd_migration/lib/src/front_end/migration_summary.dart
+++ b/pkg/nnbd_migration/lib/src/front_end/migration_summary.dart
@@ -60,6 +60,8 @@
String _keyForKind(NullabilityFixKind kind) {
switch (kind) {
+ case NullabilityFixKind.addThen:
+ return 'addThen';
case NullabilityFixKind.addImport:
return 'addImport';
case NullabilityFixKind.addLate:
diff --git a/pkg/nnbd_migration/lib/src/front_end/unit_renderer.dart b/pkg/nnbd_migration/lib/src/front_end/unit_renderer.dart
index 6f87035..0ede8f9 100644
--- a/pkg/nnbd_migration/lib/src/front_end/unit_renderer.dart
+++ b/pkg/nnbd_migration/lib/src/front_end/unit_renderer.dart
@@ -26,6 +26,7 @@
NullabilityFixKind.noValidMigrationForNull,
NullabilityFixKind.compoundAssignmentHasBadCombinedType,
NullabilityFixKind.compoundAssignmentHasNullableSource,
+ NullabilityFixKind.addThen,
NullabilityFixKind.removeDeadCode,
NullabilityFixKind.conditionTrueInStrongMode,
NullabilityFixKind.conditionFalseInStrongMode,
@@ -277,6 +278,8 @@
var s = count == 1 ? '' : 's';
var es = count == 1 ? '' : 'es';
switch (kind) {
+ case NullabilityFixKind.addThen:
+ return '$count invocation$s of `.then` added';
case NullabilityFixKind.addImport:
return '$count import$s added';
case NullabilityFixKind.addLate:
diff --git a/pkg/nnbd_migration/test/api_test.dart b/pkg/nnbd_migration/test/api_test.dart
index ff70ada..c647869 100644
--- a/pkg/nnbd_migration/test/api_test.dart
+++ b/pkg/nnbd_migration/test/api_test.dart
@@ -3357,6 +3357,32 @@
await _checkSingleFileChanges(content, expected);
}
+ Future<void> test_future_nullability_mismatch() async {
+ var content = '''
+String foo;
+
+Future<String> getNullableFoo() async {
+ return foo;
+}
+
+Future<String/*!*/> getFoo() {
+ return getNullableFoo();
+}
+''';
+ var expected = '''
+String? foo;
+
+Future<String?> getNullableFoo() async {
+ return foo;
+}
+
+Future<String> getFoo() {
+ return getNullableFoo().then((value) => value!);
+}
+''';
+ await _checkSingleFileChanges(content, expected);
+ }
+
Future<void> test_future_or_t_downcast_to_t() async {
var content = '''
import 'dart:async';
@@ -3389,6 +3415,30 @@
await _checkSingleFileChanges(content, expected);
}
+ Future<void> test_future_type_mismatch() async {
+ var content = '''
+Future<List<int>> getNullableInts() async {
+ return [null];
+}
+
+Future<List<int/*!*/>> getInts() {
+ return getNullableInts();
+}
+''';
+ // TODO(paulberry): this is not a good migration. Really we should produce
+ // getNullableInts.then((value) => value.cast());
+ var expected = '''
+Future<List<int?>> getNullableInts() async {
+ return [null];
+}
+
+Future<List<int>> getInts() {
+ return getNullableInts().then((value) => value as List<int>);
+}
+''';
+ await _checkSingleFileChanges(content, expected);
+ }
+
Future<void> test_generic_exact_propagation() async {
var content = '''
class C<T> {
diff --git a/pkg/nnbd_migration/test/edit_plan_test.dart b/pkg/nnbd_migration/test/edit_plan_test.dart
index 64ff882..078318e 100644
--- a/pkg/nnbd_migration/test/edit_plan_test.dart
+++ b/pkg/nnbd_migration/test/edit_plan_test.dart
@@ -315,6 +315,30 @@
expectedIncludingInformative: 'f() => 0 /* zero */ .isEven;');
}
+ Future<void> test_addPostfix_inner_precedence_add_parens() async {
+ await analyze('f(x) => -x;');
+ checkPlan(
+ planner.addPostfix(
+ planner.passThrough(findNode.prefix('-x')), '.abs()'),
+ 'f(x) => (-x).abs();');
+ }
+
+ Future<void> test_addPostfix_inner_precedence_no_parens() async {
+ await analyze('f(x) => x++;');
+ checkPlan(
+ planner.addPostfix(
+ planner.passThrough(findNode.postfix('x++')), '.abs()'),
+ 'f(x) => x++.abs();');
+ }
+
+ Future<void> test_addPostfix_outer_precedence() async {
+ await analyze('f(x) => x/*!*/;');
+ checkPlan(
+ planner.addPostfix(
+ planner.passThrough(findNode.simple('x/*!*/')), '.abs()'),
+ 'f(x) => x.abs()/*!*/;');
+ }
+
Future<void> test_addUnaryPostfix_inner_precedence_add_parens() async {
await analyze('f(x) => -x;');
checkPlan(
diff --git a/pkg/nnbd_migration/test/fix_aggregator_test.dart b/pkg/nnbd_migration/test/fix_aggregator_test.dart
index de9e76a..4430123 100644
--- a/pkg/nnbd_migration/test/fix_aggregator_test.dart
+++ b/pkg/nnbd_migration/test/fix_aggregator_test.dart
@@ -165,7 +165,8 @@
..addImport('package:collection/collection.dart', 'IterableExtension'),
findNode.import('package:fixnum').combinators[0]:
NodeChangeForShowCombinator()..addName('Int64'),
- findNode.expression('null'): NodeChangeForExpression()..addNullCheck(null)
+ findNode.expression('null'): NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), '''
import 'package:args/args.dart';
@@ -342,10 +343,12 @@
var aRef = findNode.simple('a +');
var bRef = findNode.simple('b;');
var previewInfo = run({
- aRef: NodeChangeForExpression()..addNullCheck(_MockInfo()),
- bRef: NodeChangeForExpression()..addNullCheck(_MockInfo()),
+ aRef: NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo()),
+ bRef: NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo()),
findNode.binary('a + b'): NodeChangeForExpression()
- ..addNullCheck(_MockInfo())
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
});
expect(previewInfo.applyTo(code), 'f(a, b) => (a! + b!)!;');
}
@@ -392,7 +395,8 @@
var previewInfo = run({
findNode.methodInvocation('f(x').argumentList: NodeChangeForArgumentList()
..dropArgument(findNode.simple('y);'), null),
- findNode.simple('x, y'): NodeChangeForExpression()..addNullCheck(null)
+ findNode.simple('x, y'): NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), '''
f([int x, int y]) => null;
@@ -404,7 +408,8 @@
var content = 'f(int x, int y) => x += y;';
await analyze(content);
var previewInfo = run({
- findNode.assignment('+='): NodeChangeForAssignment()..addNullCheck(null)
+ findNode.assignment('+='): NodeChangeForAssignment()
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), 'f(int x, int y) => (x += y)!;');
}
@@ -415,7 +420,7 @@
var previewInfo = run({
findNode.assignment('+='): NodeChangeForAssignment(),
findNode.index('[0]').target: NodeChangeForExpression()
- ..addNullCheck(null)
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), 'f(List<int> x, int y) => x![0] += y;');
}
@@ -426,7 +431,8 @@
var assignment = findNode.assignment('+=');
var previewInfo = run({
assignment: NodeChangeForAssignment(),
- assignment.rightHandSide: NodeChangeForExpression()..addNullCheck(null)
+ assignment.rightHandSide: NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), 'f(int x, int y) => x += y!;');
}
@@ -468,7 +474,9 @@
await analyze(content);
var previewInfo = run({
findNode.assignment('+='): NodeChangeForAssignment()
- ..introduceAs(nnbdTypeProvider.intType, null)
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.intType, isDowncast: false),
+ null)
});
expect(previewInfo.applyTo(code), 'f(int x, int y) => (x += y) as int;');
}
@@ -509,7 +517,7 @@
findNode.statement('if'): NodeChangeForIfStatement()
..conditionValue = true,
findNode.simple('j.isEven'): NodeChangeForExpression()
- ..addNullCheck(_MockInfo())
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
});
expect(previewInfo.applyTo(code), '''
f(int i, int/*?*/ j) {
@@ -530,7 +538,7 @@
findNode.statement('if'): NodeChangeForIfStatement()
..conditionValue = true,
findNode.simple('j.isEven'): NodeChangeForExpression()
- ..addNullCheck(_MockInfo())
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
});
expect(previewInfo.applyTo(code), '''
f(int i, int/*?*/ j) {
@@ -830,7 +838,9 @@
var cd = findNode.cascade('c..d');
var previewInfo = run({
cd: NodeChangeForExpression()
- ..introduceAs(nnbdTypeProvider.intType, _MockInfo())
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.intType, isDowncast: false),
+ _MockInfo())
});
expect(
previewInfo.applyTo(code), 'f(a, c) => a..b = (throw (c..d) as int);');
@@ -841,7 +851,9 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(nnbdTypeProvider.dynamicType, _MockInfo())
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.dynamicType, isDowncast: false),
+ _MockInfo())
});
expect(previewInfo.applyTo(code), 'f(Object o) => o as dynamic;');
}
@@ -855,7 +867,10 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(nnbdTypeProvider.futureNullType, _MockInfo())
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.futureNullType,
+ isDowncast: false),
+ _MockInfo())
});
expect(previewInfo.applyTo(code), '''
import 'dart:async' as a;
@@ -869,12 +884,14 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [],
- parameters: [],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [],
+ parameters: [],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code), 'f(Object o) => o as bool Function();');
@@ -885,15 +902,17 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [
- TypeParameterElementImpl.synthetic('T')
- ..bound = nnbdTypeProvider.numType
- ],
- parameters: [],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [
+ TypeParameterElementImpl.synthetic('T')
+ ..bound = nnbdTypeProvider.numType
+ ],
+ parameters: [],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code),
@@ -905,15 +924,17 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [
- TypeParameterElementImpl.synthetic('T')
- ..bound = nnbdTypeProvider.dynamicType
- ],
- parameters: [],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [
+ TypeParameterElementImpl.synthetic('T')
+ ..bound = nnbdTypeProvider.dynamicType
+ ],
+ parameters: [],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(
@@ -925,15 +946,17 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [
- TypeParameterElementImpl.synthetic('T')
- ..bound = nnbdTypeProvider.objectType
- ],
- parameters: [],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [
+ TypeParameterElementImpl.synthetic('T')
+ ..bound = nnbdTypeProvider.objectType
+ ],
+ parameters: [],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code),
@@ -946,16 +969,18 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [
- TypeParameterElementImpl.synthetic('T')
- ..bound = (nnbdTypeProvider.objectType as TypeImpl)
- .withNullability(NullabilitySuffix.question)
- ],
- parameters: [],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [
+ TypeParameterElementImpl.synthetic('T')
+ ..bound = (nnbdTypeProvider.objectType as TypeImpl)
+ .withNullability(NullabilitySuffix.question)
+ ],
+ parameters: [],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(
@@ -967,16 +992,18 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [
- TypeParameterElementImpl.synthetic('T')
- ..bound = (nnbdTypeProvider.numType as TypeImpl)
- .withNullability(NullabilitySuffix.question)
- ],
- parameters: [],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [
+ TypeParameterElementImpl.synthetic('T')
+ ..bound = (nnbdTypeProvider.numType as TypeImpl)
+ .withNullability(NullabilitySuffix.question)
+ ],
+ parameters: [],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code),
@@ -988,15 +1015,17 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [
- TypeParameterElementImpl.synthetic('T'),
- TypeParameterElementImpl.synthetic('U')
- ],
- parameters: [],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [
+ TypeParameterElementImpl.synthetic('T'),
+ TypeParameterElementImpl.synthetic('U')
+ ],
+ parameters: [],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code),
@@ -1008,17 +1037,19 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [],
- parameters: [
- ParameterElementImpl.synthetic(
- 'x', nnbdTypeProvider.intType, ParameterKind.REQUIRED),
- ParameterElementImpl.synthetic(
- 'y', nnbdTypeProvider.numType, ParameterKind.REQUIRED)
- ],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [],
+ parameters: [
+ ParameterElementImpl.synthetic('x',
+ nnbdTypeProvider.intType, ParameterKind.REQUIRED),
+ ParameterElementImpl.synthetic(
+ 'y', nnbdTypeProvider.numType, ParameterKind.REQUIRED)
+ ],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code),
@@ -1030,17 +1061,19 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [],
- parameters: [
- ParameterElementImpl.synthetic(
- 'x', nnbdTypeProvider.intType, ParameterKind.NAMED),
- ParameterElementImpl.synthetic(
- 'y', nnbdTypeProvider.numType, ParameterKind.NAMED)
- ],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [],
+ parameters: [
+ ParameterElementImpl.synthetic(
+ 'x', nnbdTypeProvider.intType, ParameterKind.NAMED),
+ ParameterElementImpl.synthetic(
+ 'y', nnbdTypeProvider.numType, ParameterKind.NAMED)
+ ],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code),
@@ -1052,17 +1085,19 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- FunctionTypeImpl(
- returnType: nnbdTypeProvider.boolType,
- typeFormals: [],
- parameters: [
- ParameterElementImpl.synthetic(
- 'x', nnbdTypeProvider.intType, ParameterKind.POSITIONAL),
- ParameterElementImpl.synthetic(
- 'y', nnbdTypeProvider.numType, ParameterKind.POSITIONAL)
- ],
- nullabilitySuffix: NullabilitySuffix.none),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ FunctionTypeImpl(
+ returnType: nnbdTypeProvider.boolType,
+ typeFormals: [],
+ parameters: [
+ ParameterElementImpl.synthetic('x',
+ nnbdTypeProvider.intType, ParameterKind.POSITIONAL),
+ ParameterElementImpl.synthetic('y',
+ nnbdTypeProvider.numType, ParameterKind.POSITIONAL)
+ ],
+ nullabilitySuffix: NullabilitySuffix.none),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code),
@@ -1074,9 +1109,11 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(
- nnbdTypeProvider.mapType(
- nnbdTypeProvider.intType, nnbdTypeProvider.boolType),
+ ..addExpressionChange(
+ IntroduceAsChange(
+ nnbdTypeProvider.mapType(
+ nnbdTypeProvider.intType, nnbdTypeProvider.boolType),
+ isDowncast: false),
_MockInfo())
});
expect(previewInfo.applyTo(code), 'f(Object o) => o as Map<int, bool>;');
@@ -1087,7 +1124,9 @@
var expr = findNode.binary('a | b');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(nnbdTypeProvider.intType, _MockInfo())
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.intType, isDowncast: false),
+ _MockInfo())
});
expect(previewInfo.applyTo(code), 'f(a, b) => a | b as int;');
}
@@ -1097,7 +1136,9 @@
var expr = findNode.binary('a < b');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(nnbdTypeProvider.boolType, _MockInfo())
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.boolType, isDowncast: false),
+ _MockInfo())
});
expect(previewInfo.applyTo(code), 'f(a, b) => (a < b) as bool;');
}
@@ -1110,7 +1151,10 @@
var expr = findNode.simple('o;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(nnbdTypeProvider.futureNullType, _MockInfo())
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.futureNullType,
+ isDowncast: false),
+ _MockInfo())
});
expect(previewInfo.applyTo(code), '''
import 'dart:async' as a;
@@ -1123,8 +1167,10 @@
var expr = findNode.simple('x;');
var previewInfo = run({
expr: NodeChangeForExpression()
- ..introduceAs(nnbdTypeProvider.intType, _MockInfo())
- ..addNullCheck(_MockInfo())
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.intType, isDowncast: false),
+ _MockInfo())
});
expect(previewInfo.applyTo(code), 'f(x) => x! as int;');
}
@@ -1191,8 +1237,11 @@
Future<void> test_noValidMigration() async {
await analyze('f(a) => null;');
var literal = findNode.nullLiteral('null');
- var previewInfo = run(
- {literal: NodeChangeForExpression()..addNoValidMigration(_MockInfo())});
+ var previewInfo = run({
+ literal: NodeChangeForExpression()
+ ..addExpressionChange(
+ NoValidMigrationChange(MockDartType()), _MockInfo())
+ });
expect(previewInfo.applyTo(code), code);
expect(previewInfo.applyTo(code, includeInformative: true),
'f(a) => null /* no valid migration */;');
@@ -1201,40 +1250,50 @@
Future<void> test_nullCheck_index_cascadeResult() async {
await analyze('f(a) => a..[0].c;');
var index = findNode.index('[0]');
- var previewInfo =
- run({index: NodeChangeForExpression()..addNullCheck(_MockInfo())});
+ var previewInfo = run({
+ index: NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
+ });
expect(previewInfo.applyTo(code), 'f(a) => a..[0]!.c;');
}
Future<void> test_nullCheck_methodInvocation_cascadeResult() async {
await analyze('f(a) => a..b().c;');
var method = findNode.methodInvocation('b()');
- var previewInfo = run(
- {method: NodeChangeForMethodInvocation()..addNullCheck(_MockInfo())});
+ var previewInfo = run({
+ method: NodeChangeForMethodInvocation()
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
+ });
expect(previewInfo.applyTo(code), 'f(a) => a..b()!.c;');
}
Future<void> test_nullCheck_no_parens() async {
await analyze('f(a) => a++;');
var expr = findNode.postfix('a++');
- var previewInfo =
- run({expr: NodeChangeForExpression()..addNullCheck(_MockInfo())});
+ var previewInfo = run({
+ expr: NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
+ });
expect(previewInfo.applyTo(code), 'f(a) => a++!;');
}
Future<void> test_nullCheck_parens() async {
await analyze('f(a) => -a;');
var expr = findNode.prefix('-a');
- var previewInfo =
- run({expr: NodeChangeForExpression()..addNullCheck(_MockInfo())});
+ var previewInfo = run({
+ expr: NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
+ });
expect(previewInfo.applyTo(code), 'f(a) => (-a)!;');
}
Future<void> test_nullCheck_propertyAccess_cascadeResult() async {
await analyze('f(a) => a..b.c;');
var property = findNode.propertyAccess('b');
- var previewInfo = run(
- {property: NodeChangeForPropertyAccess()..addNullCheck(_MockInfo())});
+ var previewInfo = run({
+ property: NodeChangeForPropertyAccess()
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
+ });
expect(previewInfo.applyTo(code), 'f(a) => a..b!.c;');
}
@@ -1409,7 +1468,7 @@
await analyze(content);
var previewInfo = run({
findNode.postfix('++'): NodeChangeForPostfixExpression()
- ..addNullCheck(null)
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), 'f(int x) => x++!;');
}
@@ -1420,7 +1479,7 @@
var previewInfo = run({
findNode.postfix('++'): NodeChangeForPostfixExpression(),
findNode.index('[0]').target: NodeChangeForExpression()
- ..addNullCheck(null)
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), 'f(List<int> x) => x![0]++;');
}
@@ -1430,7 +1489,9 @@
await analyze(content);
var previewInfo = run({
findNode.postfix('++'): NodeChangeForPostfixExpression()
- ..introduceAs(nnbdTypeProvider.intType, null)
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.intType, isDowncast: false),
+ null)
});
expect(previewInfo.applyTo(code), 'f(int x) => x++ as int;');
}
@@ -1471,7 +1532,8 @@
var content = 'f(int x) => ++x;';
await analyze(content);
var previewInfo = run({
- findNode.prefix('++'): NodeChangeForPrefixExpression()..addNullCheck(null)
+ findNode.prefix('++'): NodeChangeForPrefixExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), 'f(int x) => (++x)!;');
}
@@ -1482,7 +1544,7 @@
var previewInfo = run({
findNode.prefix('++'): NodeChangeForPrefixExpression(),
findNode.index('[0]').target: NodeChangeForExpression()
- ..addNullCheck(null)
+ ..addExpressionChange(NullCheckChange(MockDartType()), null)
});
expect(previewInfo.applyTo(code), 'f(List<int> x) => ++x![0];');
}
@@ -1492,7 +1554,9 @@
await analyze(content);
var previewInfo = run({
findNode.prefix('++'): NodeChangeForPrefixExpression()
- ..introduceAs(nnbdTypeProvider.intType, null)
+ ..addExpressionChange(
+ IntroduceAsChange(nnbdTypeProvider.intType, isDowncast: false),
+ null)
});
expect(previewInfo.applyTo(code), 'f(int x) => ++x as int;');
}
@@ -1727,7 +1791,8 @@
var previewInfo = run({
methodInvocation: NodeChangeForMethodInvocation()
..removeNullAwareness = true,
- argument: NodeChangeForExpression()..addNullCheck(_MockInfo())
+ argument: NodeChangeForExpression()
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
});
expect(previewInfo.applyTo(code), 'f(x) => x.m(x!);');
}
@@ -1906,7 +1971,7 @@
NodeChangeForVariableDeclarationList()
..addExplicitType = nnbdTypeProvider.intType,
findNode.integerLiteral('0'): NodeChangeForExpression()
- ..addNullCheck(_MockInfo())
+ ..addExpressionChange(NullCheckChange(MockDartType()), _MockInfo())
});
expect(previewInfo.applyTo(code), 'int x = 0!;');
}
diff --git a/pkg/nnbd_migration/test/fix_builder_test.dart b/pkg/nnbd_migration/test/fix_builder_test.dart
index e292a6f..7c6f1f7 100644
--- a/pkg/nnbd_migration/test/fix_builder_test.dart
+++ b/pkg/nnbd_migration/test/fix_builder_test.dart
@@ -3267,7 +3267,7 @@
var propertyAccess = findNode.propertyAccess('?.');
visitSubexpression(propertyAccess, 'int', changes: {
propertyAccess: TypeMatcher<NodeChangeForPropertyAccess>()
- .having((c) => c.addsNullCheck, 'addsNullCheck', true)
+ .havingNullCheckWithInfo(isNotNull)
.having((c) => c.removeNullAwareness, 'removeNullAwareness', true)
});
}
@@ -3906,21 +3906,25 @@
.having((c) => c.conditionValue, 'conditionValue', knownValue);
}
-extension on TypeMatcher<NodeChangeForExpression> {
- TypeMatcher<NodeChangeForExpression> havingNullCheckWithInfo(
- dynamic matcher) =>
- having((c) => c.addsNullCheck, 'addsNullCheck', true)
- .having((c) => c.addNullCheckInfo, 'addNullCheckInfo', matcher);
+extension _NodeChangeForExpressionExtension<T extends NodeChangeForExpression>
+ on TypeMatcher<T> {
+ TypeMatcher<T> havingExpressionChange(
+ dynamic changeMatcher, dynamic infoMatcher) =>
+ having((c) => c.expressionChanges.single, 'expressionChanges.single',
+ changeMatcher)
+ .having((c) => c.expressionChangeInfos.single,
+ 'expressionChangeInfos.single', infoMatcher);
- TypeMatcher<NodeChangeForExpression> havingNoValidMigrationWithInfo(
- dynamic matcher) =>
- having((c) => c.addsNoValidMigration, 'addsNoValidMigration', true)
- .having((c) => c.addNoValidMigrationInfo, 'addNoValidMigrationInfo',
- matcher);
+ TypeMatcher<T> havingNullCheckWithInfo(dynamic matcher) =>
+ havingExpressionChange(TypeMatcher<NullCheckChange>(), matcher);
- TypeMatcher<NodeChangeForExpression> havingIndroduceAsWithInfo(
+ TypeMatcher<T> havingNoValidMigrationWithInfo(dynamic matcher) =>
+ havingExpressionChange(TypeMatcher<NoValidMigrationChange>(), matcher);
+
+ TypeMatcher<T> havingIndroduceAsWithInfo(
dynamic typeStringMatcher, dynamic infoMatcher) =>
- having((c) => c.introducesAsType.toString(), 'introducesAsType (string)',
- typeStringMatcher)
- .having((c) => c.introducesAsInfo, 'introducesAsInfo', infoMatcher);
+ havingExpressionChange(
+ TypeMatcher<IntroduceAsChange>().having(
+ (c) => c.type.toString(), 'type (string)', typeStringMatcher),
+ infoMatcher);
}
diff --git a/pkg/vm/lib/transformations/type_flow/transformer.dart b/pkg/vm/lib/transformations/type_flow/transformer.dart
index 221cb64..427af73 100644
--- a/pkg/vm/lib/transformations/type_flow/transformer.dart
+++ b/pkg/vm/lib/transformations/type_flow/transformer.dart
@@ -697,17 +697,14 @@
positionalParameters: [parameter], returnType: const VoidType())
..fileOffset = field.fileOffset,
isAbstract: isAbstract,
- fileUri: field.fileUri,
- reference: field.setterReference);
+ fileUri: field.fileUri);
if (!isAbstract) {
_extraMembersWithReachableBody.add(accessor);
}
} else {
accessor = new Procedure(field.name, ProcedureKind.Getter,
new FunctionNode(null, returnType: field.type),
- isAbstract: true,
- fileUri: field.fileUri,
- reference: field.getterReference);
+ isAbstract: true, fileUri: field.fileUri);
}
accessor.fileOffset = field.fileOffset;
field.enclosingClass.addProcedure(accessor);
@@ -752,12 +749,6 @@
}
return _removedFields[target] ?? target;
}
-
- bool isGetterReferenceReused(Field node) =>
- _gettersForRemovedFields.containsKey(node);
-
- bool isSetterReferenceReused(Field node) =>
- _settersForRemovedFields.containsKey(node);
}
/// Visits Dart types and collects all classes and typedefs used in types.
@@ -1185,8 +1176,7 @@
if (_isUnreachable(node)) {
return _makeUnreachableInitializer([node.value]);
} else {
- final field =
- fieldMorpher.getOriginalMember(node.fieldReference.asMember) as Field;
+ final field = node.field;
assert(shaker.isMemberBodyReachable(field),
"Field should be reachable: ${field}");
if (!shaker.retainField(field)) {
@@ -1307,7 +1297,7 @@
node.reference.node == node,
"Trying to remove canonical name from reference on $node which has "
"been repurposed for ${node.reference.node}.");
- node.reference.canonicalName = null;
+ node.reference.canonicalName?.unbind();
Statistics.classesDropped++;
return removalSentinel; // Remove the class.
}
@@ -1345,34 +1335,24 @@
// Ensure that kernel file writer will not be able to
// write a dangling reference to the deleted member.
if (node is Field) {
- if (!shaker.fieldMorpher.isGetterReferenceReused(node)) {
- // The getter reference hasn't be repurposed for another node so we
- // reset the canonical name to ensure that the getter reference
- // cannot be serialized.
- assert(
- node.getterReference.node == node,
- "Trying to remove canonical name from getter reference on $node "
- "which has been repurposed for ${node.getterReference.node}.");
- node.getterReference.canonicalName = null;
- }
+ assert(
+ node.getterReference.node == node,
+ "Trying to remove canonical name from getter reference on $node "
+ "which has been repurposed for ${node.getterReference.node}.");
+ node.getterReference.canonicalName?.unbind();
if (node.hasSetter) {
- if (!shaker.fieldMorpher.isSetterReferenceReused(node)) {
- // The setter reference hasn't be repurposed for another node so we
- // reset the canonical name to ensure that the setter reference
- // cannot be serialized.
- assert(
- node.setterReference.node == node,
- "Trying to remove canonical name from reference on $node which "
- "has been repurposed for ${node.setterReference.node}.");
- node.setterReference.canonicalName = null;
- }
+ assert(
+ node.setterReference.node == node,
+ "Trying to remove canonical name from reference on $node which "
+ "has been repurposed for ${node.setterReference.node}.");
+ node.setterReference.canonicalName?.unbind();
}
} else {
assert(
node.reference.node == node,
"Trying to remove canonical name from reference on $node which has "
"been repurposed for ${node.reference.node}.");
- node.reference.canonicalName = null;
+ node.reference.canonicalName?.unbind();
}
Statistics.membersDropped++;
return removalSentinel;
diff --git a/tests/dartdevc_2/variance_subtype_test.dart b/tests/dartdevc_2/variance_subtype_test.dart
deleted file mode 100644
index b930484..0000000
--- a/tests/dartdevc_2/variance_subtype_test.dart
+++ /dev/null
@@ -1,191 +0,0 @@
-// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
-// 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.6
-
-// SharedOptions=--enable-experiment=variance
-
-// Tests runtime subtyping with explicit variance modifiers.
-
-import 'dart:_runtime' show typeRep;
-import 'dart:async' show FutureOr;
-
-import 'runtime_utils.dart';
-
-class Upper {}
-
-class Middle extends Upper {}
-
-class Lower extends Middle {}
-
-class Covariant<out T> {}
-
-class Contravariant<in T> {}
-
-class Invariant<inout T> {}
-
-class LegacyCovariant<T> {}
-
-void main() {
- // Covariant<Lower> <: Covariant<Middle>
- checkProperSubtype(typeRep<Covariant<Lower>>(), typeRep<Covariant<Middle>>());
-
- // Covariant<Middle> <: Covariant<Middle>
- checkSubtype(typeRep<Covariant<Middle>>(), typeRep<Covariant<Middle>>());
-
- // Contravariant<Upper> <: Contravariant<Middle>
- checkProperSubtype(
- typeRep<Contravariant<Upper>>(), typeRep<Contravariant<Middle>>());
-
- // Contravariant<Middle> <: Contravariant<Middle>
- checkSubtype(
- typeRep<Contravariant<Middle>>(), typeRep<Contravariant<Middle>>());
-
- // Invariant<Middle> <: Invariant<Middle>
- checkSubtype(typeRep<Invariant<Middle>>(), typeRep<Invariant<Middle>>());
-
- // Invariant<dynamic> <:> Invariant<Object>
- checkMutualSubtype(
- typeRep<Invariant<dynamic>>(), typeRep<Invariant<Object>>());
-
- // Invariant<FutureOr<dynamic>> <:> Invariant<dynamic>
- checkMutualSubtype(
- typeRep<Invariant<FutureOr<dynamic>>>(), typeRep<Invariant<dynamic>>());
-
- // Invariant<FutureOr<Null>> <:> Invariant<Future<Null>>
- checkMutualSubtype(
- typeRep<Invariant<FutureOr<Null>>>(), typeRep<Invariant<Future<Null>>>());
-
- // LegacyCovariant<Lower> <: LegacyCovariant<Middle>
- checkProperSubtype(
- typeRep<LegacyCovariant<Lower>>(), typeRep<LegacyCovariant<Middle>>());
-
- // List<Covariant<Lower>> <: Iterable<Covariant<Middle>>
- checkProperSubtype(typeRep<List<Covariant<Lower>>>(),
- typeRep<Iterable<Covariant<Middle>>>());
-
- // List<Contravariant<Upper>> <: Iterable<Contravariant<Middle>>
- checkProperSubtype(typeRep<List<Contravariant<Upper>>>(),
- typeRep<Iterable<Contravariant<Middle>>>());
-
- // List<Invariant<Middle>> <: Iterable<Invariant<Middle>>
- checkProperSubtype(typeRep<List<Invariant<Middle>>>(),
- typeRep<Iterable<Invariant<Middle>>>());
-
- // List<LegacyCovariant<Lower>> <: Iterable<LegacyCovariant<Middle>>
- checkProperSubtype(typeRep<List<LegacyCovariant<Lower>>>(),
- typeRep<Iterable<LegacyCovariant<Middle>>>());
-
- // String -> Covariant<Lower> <: String -> Covariant<Middle>
- checkProperSubtype(typeRep<Covariant<Lower> Function(String)>(),
- typeRep<Covariant<Middle> Function(String)>());
-
- // Covariant<Upper> -> String <: Covariant<Middle> -> String
- checkProperSubtype(typeRep<String Function(Covariant<Upper>)>(),
- typeRep<String Function(Covariant<Middle>)>());
-
- // String -> Contravariant<Upper> <: String -> Contravariant<Middle>
- checkProperSubtype(typeRep<Contravariant<Upper> Function(String)>(),
- typeRep<Contravariant<Middle> Function(String)>());
-
- // Contravariant<Lower> -> String <: Contravariant<Middle> -> String
- checkProperSubtype(typeRep<String Function(Contravariant<Lower>)>(),
- typeRep<String Function(Contravariant<Middle>)>());
-
- // String -> Invariant<Middle> <: String -> Invariant<Middle>
- checkSubtype(typeRep<String Function(Invariant<Middle>)>(),
- typeRep<String Function(Invariant<Middle>)>());
-
- // Invariant<Middle> -> String <: Invariant<Middle> -> String
- checkSubtype(typeRep<String Function(Invariant<Middle>)>(),
- typeRep<String Function(Invariant<Middle>)>());
-
- // String -> LegacyCovariant<Lower> <: String -> LegacyCovariant<Middle>
- checkProperSubtype(typeRep<LegacyCovariant<Lower> Function(String)>(),
- typeRep<LegacyCovariant<Middle> Function(String)>());
-
- // LegacyCovariant<Upper> -> String <: LegacyCovariant<Middle> -> String
- checkProperSubtype(typeRep<String Function(LegacyCovariant<Upper>)>(),
- typeRep<String Function(LegacyCovariant<Middle>)>());
-
- // Covariant<Upper> </: Covariant<Middle>
- checkSubtypeFailure(
- typeRep<Covariant<Upper>>(), typeRep<Covariant<Middle>>());
-
- // Contravariant<Lower> </: Contravariant<Middle>
- checkSubtypeFailure(
- typeRep<Contravariant<Lower>>(), typeRep<Contravariant<Middle>>());
-
- // Invariant<Upper> </: Invariant<Middle>
- checkSubtypeFailure(
- typeRep<Invariant<Upper>>(), typeRep<Invariant<Middle>>());
-
- // Invariant<Lower> </: Invariant<Middle>
- checkSubtypeFailure(
- typeRep<Invariant<Lower>>(), typeRep<Invariant<Middle>>());
-
- // LegacyCovariant<Upper> </: LegacyCovariant<Middle>
- checkSubtypeFailure(
- typeRep<LegacyCovariant<Upper>>(), typeRep<LegacyCovariant<Middle>>());
-
- // List<Covariant<Upper>> </: Iterable<Covariant<Middle>>
- checkSubtypeFailure(typeRep<List<Covariant<Upper>>>(),
- typeRep<Iterable<Covariant<Middle>>>());
-
- // List<Contravariant<Lower>> </: Iterable<Contravariant<Middle>>
- checkSubtypeFailure(typeRep<List<Contravariant<Lower>>>(),
- typeRep<Iterable<Contravariant<Middle>>>());
-
- // List<Invariant<Upper>> </: Iterable<Invariant<Middle>>
- checkSubtypeFailure(typeRep<List<Invariant<Upper>>>(),
- typeRep<Iterable<Invariant<Middle>>>());
-
- // List<Invariant<Lower>> </: Iterable<Invariant<Middle>>
- checkSubtypeFailure(typeRep<List<Invariant<Lower>>>(),
- typeRep<Iterable<Invariant<Middle>>>());
-
- // List<LegacyCovariant<Upper>> </: Iterable<LegacyCovariant<Middle>>
- checkSubtypeFailure(typeRep<List<LegacyCovariant<Upper>>>(),
- typeRep<Iterable<LegacyCovariant<Middle>>>());
-
- // String -> Covariant<Upper> </: String -> Covariant<Middle>
- checkSubtypeFailure(typeRep<Covariant<Upper> Function(String)>(),
- typeRep<Covariant<Middle> Function(String)>());
-
- // Covariant<Lower> -> String </: Covariant<Middle> -> String
- checkSubtypeFailure(typeRep<String Function(Covariant<Lower>)>(),
- typeRep<String Function(Covariant<Middle>)>());
-
- // String -> Contravariant<Lower> </: String -> Contravariant<Middle>
- checkSubtypeFailure(typeRep<Contravariant<Lower> Function(String)>(),
- typeRep<Contravariant<Middle> Function(String)>());
-
- // Contravariant<Upper> -> String </: Contravariant<Middle> -> String
- checkSubtypeFailure(typeRep<String Function(Contravariant<Upper>)>(),
- typeRep<String Function(Contravariant<Middle>)>());
-
- // String -> Invariant<Upper> </: String -> Invariant<Middle>
- checkSubtypeFailure(typeRep<Invariant<Upper> Function(String)>(),
- typeRep<Invariant<Middle> Function(String)>());
-
- // Invariant<Upper> -> String </: Invariant<Middle> -> String
- checkSubtypeFailure(typeRep<String Function(Invariant<Upper>)>(),
- typeRep<String Function(Invariant<Middle>)>());
-
- // String -> Invariant<Lower> </: String -> Invariant<Middle>
- checkSubtypeFailure(typeRep<Invariant<Lower> Function(String)>(),
- typeRep<Invariant<Middle> Function(String)>());
-
- // Invariant<Lower> -> String <: Invariant<Middle> -> String
- checkSubtypeFailure(typeRep<String Function(Invariant<Lower>)>(),
- typeRep<String Function(Invariant<Middle>)>());
-
- // String -> LegacyCovariant<Upper> </: String -> LegacyCovariant<Middle>
- checkSubtypeFailure(typeRep<LegacyCovariant<Upper> Function(String)>(),
- typeRep<LegacyCovariant<Middle> Function(String)>());
-
- // LegacyCovariant<Lower> -> String </: LegacyCovariant<Middle> -> String
- checkSubtypeFailure(typeRep<String Function(LegacyCovariant<Lower>)>(),
- typeRep<String Function(LegacyCovariant<Middle>)>());
-}
diff --git a/tests/dartdevc_2/variance_test.dart b/tests/dartdevc_2/variance_test.dart
deleted file mode 100644
index 6d84f2f..0000000
--- a/tests/dartdevc_2/variance_test.dart
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
-// 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.6
-
-// SharedOptions=--enable-experiment=variance
-
-// Tests the emission of explicit variance modifiers.
-
-import 'dart:_runtime'
- show getGenericArgVariances, Variance, legacyTypeRep;
-
-import 'package:expect/expect.dart';
-
-class A<in T> {}
-
-class B<out T> {}
-
-class C<inout T> {}
-
-class D<T> {}
-
-class E<inout X, out Y, in Z> {}
-
-mixin F<in T> {}
-
-class G<inout T> = Object with F<T>;
-
-List getVariances(dynamic type) {
- // TODO(nshahan) Revisit when we decide if getGenericArgVariances will handle
- // legacy and nullable wrappers.
- return getGenericArgVariances(type.type);
-}
-
-main() {
- Expect.listEquals([Variance.contravariant], getVariances(legacyTypeRep<A>()));
-
- Expect.listEquals([Variance.covariant], getVariances(legacyTypeRep<B>()));
-
- Expect.listEquals([Variance.invariant], getVariances(legacyTypeRep<C>()));
-
- // Implicit variance is not emitted into the generated code.
- Expect.isNull(getVariances(legacyTypeRep<D>()));
-
- Expect.listEquals(
- [Variance.invariant, Variance.covariant, Variance.contravariant],
- getVariances(legacyTypeRep<E>()));
-
- Expect.listEquals([Variance.contravariant], getVariances(legacyTypeRep<F>()));
-
- Expect.listEquals([Variance.invariant], getVariances(legacyTypeRep<G>()));
-}
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index aaaf533..7b214ff 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -14,6 +14,7 @@
[ $builder_tag == dart2js_production && $compiler == dart2js ]
control_flow_collections/for_non_bool_condition_test: Crash # Issue 36442
+regress/regress45428_test: SkipByDesign # No argument type checks in production mode, issue 45528
[ $compiler == dart2js && $runtime == chromeOnAndroid ]
override_field_test/02: Slow, Pass # TODO(kasperl): Please triage.
diff --git a/tests/language/regress/regress45428_test.dart b/tests/language/regress/regress45428_test.dart
new file mode 100644
index 0000000..37c1427
--- /dev/null
+++ b/tests/language/regress/regress45428_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+import 'package:expect/expect.dart';
+
+void something(List<String> l) {
+ String s = l.first;
+}
+
+void checkAndInvoke(Function f) {
+ f(["foo"]);
+ var l = <int>[1];
+ Expect.throwsTypeError(() => f(l));
+ if (f is Function(List<Never>)) {
+ Expect.throwsTypeError(() => (f as Function)(l));
+ }
+}
+
+void main() {
+ checkAndInvoke(something);
+}
diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status
index aaaf533..7b214ff 100644
--- a/tests/language_2/language_2_dart2js.status
+++ b/tests/language_2/language_2_dart2js.status
@@ -14,6 +14,7 @@
[ $builder_tag == dart2js_production && $compiler == dart2js ]
control_flow_collections/for_non_bool_condition_test: Crash # Issue 36442
+regress/regress45428_test: SkipByDesign # No argument type checks in production mode, issue 45528
[ $compiler == dart2js && $runtime == chromeOnAndroid ]
override_field_test/02: Slow, Pass # TODO(kasperl): Please triage.
diff --git a/tests/language_2/regress/regress45428_test.dart b/tests/language_2/regress/regress45428_test.dart
new file mode 100644
index 0000000..37c1427
--- /dev/null
+++ b/tests/language_2/regress/regress45428_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+import 'package:expect/expect.dart';
+
+void something(List<String> l) {
+ String s = l.first;
+}
+
+void checkAndInvoke(Function f) {
+ f(["foo"]);
+ var l = <int>[1];
+ Expect.throwsTypeError(() => f(l));
+ if (f is Function(List<Never>)) {
+ Expect.throwsTypeError(() => (f as Function)(l));
+ }
+}
+
+void main() {
+ checkAndInvoke(something);
+}
diff --git a/tests/web/deferred/shadowed_types/lib_shared.dart b/tests/web/deferred/shadowed_types/lib_shared.dart
new file mode 100644
index 0000000..ee8202f
--- /dev/null
+++ b/tests/web/deferred/shadowed_types/lib_shared.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+// Class A has a type used in libb, but a class used in liba.
+class A {}
+
+// Class B has a class used in the main output unit, and a type used in libb.
+class B {}
+
+// Class C_Parent is extended is libb, and closed around in the main output
+// unit.
+class C_Parent {}
+
+// Classes D through F represent a simple heirarchy.
+// D's type is used in liba.
+// F is instantiated, but unused in libb.
+class D {}
+
+class E extends D {}
+
+class F {}
diff --git a/tests/web/deferred/shadowed_types/liba.dart b/tests/web/deferred/shadowed_types/liba.dart
new file mode 100644
index 0000000..7283385
--- /dev/null
+++ b/tests/web/deferred/shadowed_types/liba.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+import 'lib_shared.dart';
+
+@pragma('dart2js:noInline')
+isA(foo) {
+ return foo is A;
+}
+
+@pragma('dart2js:noInline')
+isD(foo) {
+ return foo is D;
+}
diff --git a/tests/web/deferred/shadowed_types/libb.dart b/tests/web/deferred/shadowed_types/libb.dart
new file mode 100644
index 0000000..1a9e83c
--- /dev/null
+++ b/tests/web/deferred/shadowed_types/libb.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+import 'lib_shared.dart';
+
+@pragma('dart2js:noInline')
+createA() {
+ return A();
+}
+
+@pragma('dart2js:noInline')
+isB(foo) {
+ return foo is B;
+}
+
+class C extends C_Parent {}
+
+@pragma('dart2js:noInline')
+createC() {
+ return C();
+}
+
+@pragma('dart2js:noInline')
+createE() {
+ return E();
+}
+
+@pragma('dart2js:noInline')
+isFWithUnused(foo) {
+ var unused = F();
+ return foo is F;
+}
diff --git a/tests/web/deferred/shadowed_types/shadowed_types_test.dart b/tests/web/deferred/shadowed_types/shadowed_types_test.dart
new file mode 100644
index 0000000..0bc3fa0
--- /dev/null
+++ b/tests/web/deferred/shadowed_types/shadowed_types_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+import 'package:expect/expect.dart';
+import 'liba.dart' deferred as liba;
+import 'libb.dart' deferred as libb;
+import 'lib_shared.dart';
+
+main() async {
+ var f = () => libb.C();
+ Expect.isTrue(f is C_Parent Function());
+ await liba.loadLibrary();
+ await libb.loadLibrary();
+
+ Expect.isTrue(liba.isA(libb.createA()));
+ print(libb.createA());
+ print(libb.createC());
+ Expect.isTrue(libb.isB(B()));
+ Expect.isTrue(liba.isD(libb.createE()));
+ Expect.isFalse(libb.isFWithUnused(null as dynamic));
+}
diff --git a/tools/VERSION b/tools/VERSION
index 9f2ecc3..7096fe2 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 13
PATCH 0
-PRERELEASE 186
+PRERELEASE 187
PRERELEASE_PATCH 0
\ No newline at end of file