Version 2.17.0-259.0.dev
Merge commit '10bbfbebc91f54c3e445ace526fbe76406f99444' into 'dev'
diff --git a/DEPS b/DEPS
index 9d89269..4799c7d 100644
--- a/DEPS
+++ b/DEPS
@@ -110,7 +110,7 @@
"dart_style_rev": "d7b73536a8079331c888b7da539b80e6825270ea",
"dartdoc_rev" : "334072b0cad436c05f6bcecf8a1a59f2f0809b84",
- "devtools_rev" : "65c40d3f6b3dd03411cb8f4b0c0b1ecaa9148f26",
+ "devtools_rev" : "2a707ca56c1a9d5eeef212c28c573548a051fdd2",
"ffi_rev": "4dd32429880a57b64edaf54c9d5af8a9fa9a4ffb",
"fixnum_rev": "848341f061359ef7ddc0cad472c2ecbb036b28ac",
"file_rev": "1ebc38852ffed24b564910317982298b56c2cedd",
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
index ac0df68..4522ffc 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
@@ -8,6 +8,7 @@
import 'package:analysis_server/src/utilities/extensions/range_factory.dart';
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/source/source_range.dart';
@@ -136,15 +137,49 @@
await builder.addDartFileEdit(file, (builder) {
// Convert the parameters.
for (var parameterData in allParameters) {
+ var keyword = parameterData.finalKeyword;
+
+ void insertSuper() {
+ if (keyword == null) {
+ builder.addSimpleInsertion(parameterData.nameOffset, 'super.');
+ } else {
+ var tokenAfterKeyword = keyword.next!;
+ if (tokenAfterKeyword.offset == parameterData.nameOffset) {
+ builder.addSimpleReplacement(
+ range.startStart(keyword, tokenAfterKeyword), 'super.');
+ } else {
+ builder.addDeletion(range.startStart(keyword, tokenAfterKeyword));
+ builder.addSimpleInsertion(parameterData.nameOffset, 'super.');
+ }
+ }
+ }
+
var typeToDelete = parameterData.typeToDelete;
if (typeToDelete == null) {
- builder.addSimpleInsertion(parameterData.nameOffset, 'super.');
+ insertSuper();
} else {
var primaryRange = typeToDelete.primaryRange;
if (primaryRange == null) {
+ // This only happens when the type is an inline function type with
+ // no return type, such as `f(int i)`. Inline function types can't
+ // have a `final` keyword unless there's an error in the code.
builder.addSimpleInsertion(parameterData.nameOffset, 'super.');
} else {
- builder.addSimpleReplacement(primaryRange, 'super.');
+ if (keyword == null) {
+ builder.addSimpleReplacement(primaryRange, 'super.');
+ } else {
+ var tokenAfterKeyword = keyword.next!;
+ if (tokenAfterKeyword.offset == primaryRange.offset) {
+ builder.addSimpleReplacement(
+ range.startOffsetEndOffset(
+ keyword.offset, primaryRange.end),
+ 'super.');
+ } else {
+ builder
+ .addDeletion(range.startStart(keyword, tokenAfterKeyword));
+ builder.addSimpleReplacement(primaryRange, 'super.');
+ }
+ }
}
var parameterRange = typeToDelete.parameterRange;
if (parameterRange != null) {
@@ -200,20 +235,24 @@
if (!typeSystem.isSubtypeOf(thisType, superType)) {
return null;
}
- var identifier = parameter.parameter.identifier;
+
+ var parameterNode = parameter.parameter;
+ var identifier = parameterNode.identifier;
if (identifier == null) {
// This condition should never occur, but the test is here to promote the
// type.
return null;
}
+
// Return the data.
return _ParameterData(
argumentIndex: argumentIndex,
- defaultValueRange: _defaultValueRange(
- parameter.parameter, superParameter, parameter.element),
+ defaultValueRange:
+ _defaultValueRange(parameterNode, superParameter, parameter.element),
+ finalKeyword: _finalKeyword(parameterNode),
nameOffset: identifier.offset,
parameterIndex: parameter.index,
- typeToDelete: superType == thisType ? _type(parameter.parameter) : null,
+ typeToDelete: superType == thisType ? _type(parameterNode) : null,
);
}
@@ -235,6 +274,21 @@
return null;
}
+ /// Return data about the type annotation on the [parameter]. This is the
+ /// information about the ranges of text that need to be removed in order to
+ /// remove the type annotation.
+ Token? _finalKeyword(FormalParameter parameter) {
+ if (parameter is DefaultFormalParameter) {
+ return _finalKeyword(parameter.parameter);
+ } else if (parameter is SimpleFormalParameter) {
+ var keyword = parameter.keyword;
+ if (keyword?.type == Keyword.FINAL) {
+ return keyword;
+ }
+ }
+ return null;
+ }
+
/// Return the constructor to be converted, or `null` if the cursor is not on
/// the name of a constructor.
ConstructorDeclaration? _findConstructor() {
@@ -376,6 +430,10 @@
/// Information used to convert a single parameter.
class _ParameterData {
+ /// The `final` keyword on the parameter, or `null` if there is no `final`
+ /// keyword.
+ final Token? finalKeyword;
+
/// The type annotation that should be deleted from the parameter list, or
/// `null` if there is no type annotation to delete or if the type should not
/// be deleted.
@@ -397,7 +455,8 @@
/// Initialize a newly create data object.
_ParameterData(
- {required this.typeToDelete,
+ {required this.finalKeyword,
+ required this.typeToDelete,
required this.nameOffset,
required this.defaultValueRange,
required this.parameterIndex,
diff --git a/pkg/analysis_server/test/src/services/correction/assist/convert_to_super_parameters_test.dart b/pkg/analysis_server/test/src/services/correction/assist/convert_to_super_parameters_test.dart
index 1bf7f74..1af8888 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/convert_to_super_parameters_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/convert_to_super_parameters_test.dart
@@ -164,6 +164,70 @@
''');
}
+ Future<void> test_final_named_withoutType() async {
+ await resolveTestCode('''
+class A {
+ A({required int x});
+}
+class B extends A {
+ B({required final x}) : super(x: x);
+}
+''');
+ // `dynamic` is not a subtype of `int`
+ await assertNoAssistAt('B(');
+ }
+
+ Future<void> test_final_named_withType() async {
+ await resolveTestCode('''
+class A {
+ A({required int x});
+}
+class B extends A {
+ B({required final int x}) : super(x: x);
+}
+''');
+ await assertHasAssistAt('B(', '''
+class A {
+ A({required int x});
+}
+class B extends A {
+ B({required super.x});
+}
+''');
+ }
+
+ Future<void> test_final_positional_withoutType() async {
+ await resolveTestCode('''
+class A {
+ A(int x);
+}
+class B extends A {
+ B(final x) : super(x);
+}
+''');
+ // `dynamic` is not a subtype of `int`
+ await assertNoAssistAt('B(');
+ }
+
+ Future<void> test_final_positional_withType() async {
+ await resolveTestCode('''
+class A {
+ A(int x);
+}
+class B extends A {
+ B(final int x) : super(x);
+}
+''');
+ await assertHasAssistAt('B(', '''
+class A {
+ A(int x);
+}
+class B extends A {
+ B(super.x);
+}
+''');
+ }
+
Future<void> test_functionTypedFormalParameter() async {
await resolveTestCode('''
class A {
diff --git a/pkg/compiler/lib/src/commandline_options.dart b/pkg/compiler/lib/src/commandline_options.dart
index 55ad35e..6a7da07 100644
--- a/pkg/compiler/lib/src/commandline_options.dart
+++ b/pkg/compiler/lib/src/commandline_options.dart
@@ -112,6 +112,7 @@
static const String reportAllMetrics = '--report-all-metrics';
static const String dillDependencies = '--dill-dependencies';
+ static const String sources = '--sources';
static const String readData = '--read-data';
static const String writeData = '--write-data';
static const String noClosedWorldInData = '--no-closed-world-in-data';
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 029efeb..62f3328 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -23,7 +23,6 @@
import 'deferred_load/program_split_constraints/nodes.dart' as psc
show ConstraintData;
import 'deferred_load/program_split_constraints/parser.dart' as psc show Parser;
-import 'diagnostics/code_location.dart';
import 'diagnostics/messages.dart' show Message;
import 'dump_info.dart' show DumpInfoTask;
import 'elements/entities.dart';
@@ -87,8 +86,6 @@
api.CompilerOutput get outputProvider => _outputProvider;
- final List<CodeLocation> _userCodeLocations = <CodeLocation>[];
-
ir.Component componentForTesting;
JClosedWorld backendClosedWorldForTesting;
DataSourceIndices closedWorldIndicesForTesting;
@@ -413,10 +410,7 @@
}
await serializationTask.serializeComponent(component);
}
- // We currently do not return the trimmed component from [produceKernel]
- // because downstream phases, in particular modular analysis, currently
- // depend on the untrimmed dill.
- return output;
+ return output.withNewComponent(component);
} else {
ir.Component component =
await serializationTask.deserializeComponentAndUpdateOptions();
@@ -431,8 +425,6 @@
load_kernel.Output output, Set<Uri> moduleLibraries) async {
ir.Component component = output.component;
List<Uri> libraries = output.libraries;
- _userCodeLocations
- .addAll(moduleLibraries.map((module) => CodeLocation(module)));
final input = modular_analysis.Input(
options, reporter, environment, component, libraries, moduleLibraries);
return await selfTask.measureSubtask(
@@ -541,7 +533,6 @@
if (options.readClosedWorldUri == null) {
Uri rootLibraryUri = output.rootLibraryUri;
Iterable<Uri> libraries = output.libraries;
- _userCodeLocations.add(CodeLocation(rootLibraryUri));
JsClosedWorld closedWorld =
computeClosedWorld(component, moduleData, rootLibraryUri, libraries);
closedWorldAndIndices = ClosedWorldAndIndices(closedWorld, null);
@@ -819,38 +810,9 @@
}
}
- /// Helper for determining whether the current element is declared within
- /// 'user code'.
- ///
- /// See [inUserCode] for what defines 'user code'.
- bool currentlyInUserCode() {
- return inUserCode(currentElement);
- }
-
/// Helper for determining whether [element] is declared within 'user code'.
- ///
- /// What constitutes 'user code' is defined by the URI(s) provided by the
- /// entry point(s) of compilation or analysis:
- ///
- /// If an entrypoint URI uses the 'package' scheme then every library from
- /// that same package is considered to be in user code. For instance, if
- /// an entry point URI is 'package:foo/bar.dart' then every library whose
- /// canonical URI starts with 'package:foo/' is in user code.
- ///
- /// If an entrypoint URI uses another scheme than 'package' then every library
- /// with that scheme is in user code. For instance, an entry point URI is
- /// 'file:///foo.dart' then every library whose canonical URI scheme is
- /// 'file' is in user code.
- ///
- /// If [assumeInUserCode] is `true`, [element] is assumed to be in user code
- /// if no entrypoints have been set.
- bool inUserCode(Entity element, {bool assumeInUserCode = false}) {
- if (element == null) return assumeInUserCode;
- Uri libraryUri = _uriFromElement(element);
- if (libraryUri == null) return false;
- if (_userCodeLocations.isEmpty && assumeInUserCode) return true;
- return _userCodeLocations.any(
- (CodeLocation codeLocation) => codeLocation.inSameLocation(libraryUri));
+ bool inUserCode(Entity element) {
+ return element == null || _uriFromElement(element) != null;
}
/// Return a canonical URI for the source of [element].
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index b78f0fc..f323ee3 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -133,6 +133,7 @@
bool showWarnings;
bool showHints;
bool enableColors;
+ List<Uri> sources;
int optimizationLevel = null;
Uri platformBinaries;
Map<String, String> environment = Map<String, String>();
@@ -289,11 +290,12 @@
Uri.base.resolve(extractPath(argument, isDirectory: true));
}
- void setUriList(String flag, String argument) {
+ List<Uri> setUriList(String flag, String argument) {
String list = extractParameter(argument);
- String uriList = list.splitMapJoin(',',
- onMatch: (_) => ',', onNonMatch: (p) => '${fe.nativeToUri(p)}');
+ List<Uri> uris = list.split(',').map(fe.nativeToUri).toList();
+ String uriList = uris.map((uri) => '$uri').join(',');
options.add('${flag}=${uriList}');
+ return uris;
}
void setModularAnalysisInputs(String argument) {
@@ -361,6 +363,10 @@
setUriList(Flags.dillDependencies, argument);
}
+ void setSources(String argument) {
+ sources = setUriList(Flags.sources, argument);
+ }
+
void setCfeOnly(String argument) {
if (writeStrategy == WriteStrategy.toModularAnalysis) {
fail("Cannot use ${Flags.cfeOnly} "
@@ -547,6 +553,7 @@
OptionHandler('--library-root=.+', ignoreOption),
OptionHandler('--libraries-spec=.+', setLibrarySpecificationUri),
OptionHandler('${Flags.dillDependencies}=.+', setDillDependencies),
+ OptionHandler('${Flags.sources}=.+', setSources),
OptionHandler('${Flags.readModularAnalysis}=.+', setModularAnalysisInputs),
OptionHandler(
'${Flags.writeModularAnalysis}|${Flags.writeModularAnalysis}=.+',
@@ -761,7 +768,10 @@
helpAndExit(wantHelp, wantVersion, diagnosticHandler.verbose);
}
- if (arguments.isEmpty && entryUri == null && inputDillUri == null) {
+ if (arguments.isEmpty &&
+ entryUri == null &&
+ inputDillUri == null &&
+ sources == null) {
helpAndFail('No Dart file specified.');
}
@@ -787,8 +797,11 @@
}
// Make [scriptName] a relative path..
- String scriptName =
- fe.relativizeUri(Uri.base, inputDillUri ?? entryUri, Platform.isWindows);
+ String scriptName = sources == null
+ ? fe.relativizeUri(Uri.base, inputDillUri ?? entryUri, Platform.isWindows)
+ : sources
+ .map((uri) => fe.relativizeUri(Uri.base, uri, Platform.isWindows))
+ .join(',');
switch (writeStrategy) {
case WriteStrategy.toJs:
diff --git a/pkg/compiler/lib/src/diagnostics/code_location.dart b/pkg/compiler/lib/src/diagnostics/code_location.dart
deleted file mode 100644
index 515f359..0000000
--- a/pkg/compiler/lib/src/diagnostics/code_location.dart
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2012, 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 dart2js.diagnostics.code_location;
-
-import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
-
-/// [CodeLocation] divides uris into different classes.
-///
-/// These are used to group uris from user code, platform libraries and
-/// packages.
-abstract class CodeLocation {
- /// Returns `true` if [uri] is in this code location.
- bool inSameLocation(Uri uri);
-
- /// Returns the uri of this location relative to [baseUri].
- String relativize(Uri baseUri);
-
- factory CodeLocation(Uri uri) {
- if (uri.isScheme('package')) {
- int slashPos = uri.path.indexOf('/');
- if (slashPos != -1) {
- String packageName = uri.path.substring(0, slashPos);
- return PackageLocation(packageName);
- } else {
- return UriLocation(uri);
- }
- } else {
- return SchemeLocation(uri);
- }
- }
-}
-
-/// A code location defined by the scheme of the uri.
-///
-/// Used for non-package uris, such as 'dart', 'file', and 'http'.
-class SchemeLocation implements CodeLocation {
- final Uri uri;
-
- SchemeLocation(this.uri);
-
- @override
- bool inSameLocation(Uri uri) {
- return this.uri.isScheme(uri.scheme);
- }
-
- @override
- String relativize(Uri baseUri) {
- return fe.relativizeUri(baseUri, uri, false);
- }
-}
-
-/// A code location defined by the package name.
-///
-/// Used for package uris, separated by their `package names`, that is, the
-/// 'foo' of 'package:foo/bar.dart'.
-class PackageLocation implements CodeLocation {
- final String packageName;
-
- PackageLocation(this.packageName);
-
- @override
- bool inSameLocation(Uri uri) {
- return uri.isScheme('package') && uri.path.startsWith('$packageName/');
- }
-
- @override
- String relativize(Uri baseUri) => 'package:$packageName';
-}
-
-/// A code location defined by the whole uri.
-///
-/// Used for package uris with no package name. For instance 'package:foo.dart'.
-class UriLocation implements CodeLocation {
- final Uri uri;
-
- UriLocation(this.uri);
-
- @override
- bool inSameLocation(Uri uri) => this.uri == uri;
-
- @override
- String relativize(Uri baseUri) {
- return fe.relativizeUri(baseUri, uri, false);
- }
-}
-
-/// A code location that contains any uri.
-class AnyLocation implements CodeLocation {
- const AnyLocation();
-
- @override
- bool inSameLocation(Uri uri) => true;
-
- @override
- String relativize(Uri baseUri) => '$baseUri';
-}
diff --git a/pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart b/pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart
index 4b895a4..5fab3db 100644
--- a/pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart
+++ b/pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart
@@ -90,7 +90,7 @@
case api.Diagnostic.WARNING:
case api.Diagnostic.HINT:
Entity element = _elementFromSpannable(message.spannable);
- if (!_compiler.inUserCode(element, assumeInUserCode: true)) {
+ if (!_compiler.inUserCode(element)) {
Uri uri = _compiler.getCanonicalUri(element);
if (options.showPackageWarningsFor(uri)) {
_reportDiagnostic(message, infos, kind);
diff --git a/pkg/compiler/lib/src/options.dart b/pkg/compiler/lib/src/options.dart
index b24e672..554f833 100644
--- a/pkg/compiler/lib/src/options.dart
+++ b/pkg/compiler/lib/src/options.dart
@@ -171,6 +171,7 @@
Uri? get compilationTarget => inputDillUri ?? entryUri;
bool get fromDill {
+ if (sources != null) return false;
var targetPath = compilationTarget!.path;
return targetPath.endsWith('.dill');
}
@@ -191,6 +192,9 @@
/// files for linking.
List<Uri>? dillDependencies;
+ /// A list of sources to compile, only used for modular analysis.
+ List<Uri>? sources;
+
Uri? writeModularAnalysisUri;
/// Helper to determine if compiler is being run just for modular analysis.
@@ -676,6 +680,7 @@
..showInternalProgress = _hasOption(options, Flags.progress)
..dillDependencies =
_extractUriListOption(options, '${Flags.dillDependencies}')
+ ..sources = _extractUriListOption(options, '${Flags.sources}')
..readProgramSplit =
_extractUriOption(options, '${Flags.readProgramSplit}=')
..writeModularAnalysisUri =
diff --git a/pkg/compiler/lib/src/phase/load_kernel.dart b/pkg/compiler/lib/src/phase/load_kernel.dart
index 44314a7..e16d5fb 100644
--- a/pkg/compiler/lib/src/phase/load_kernel.dart
+++ b/pkg/compiler/lib/src/phase/load_kernel.dart
@@ -64,6 +64,9 @@
final fe.InitializedCompilerState initializedCompilerState;
+ Output withNewComponent(ir.Component component) => Output(component,
+ rootLibraryUri, libraries, moduleLibraries, initializedCompilerState);
+
Output(this.component, this.rootLibraryUri, this.libraries,
this.moduleLibraries, this.initializedCompilerState);
}
@@ -195,8 +198,10 @@
class _LoadFromSourceResult {
final ir.Component component;
final fe.InitializedCompilerState initializedCompilerState;
+ final List<Uri> moduleLibraries;
- _LoadFromSourceResult(this.component, this.initializedCompilerState);
+ _LoadFromSourceResult(
+ this.component, this.initializedCompilerState, this.moduleLibraries);
}
Future<_LoadFromSourceResult> _loadFromSource(
@@ -215,21 +220,36 @@
reportFrontEndMessage(reporter, message);
}
};
- fe.CompilerOptions feOptions = fe.CompilerOptions()
- ..target = target
- ..librariesSpecificationUri = options.librariesSpecificationUri
- ..packagesFileUri = options.packageConfig
- ..explicitExperimentalFlags = options.explicitExperimentalFlags
- ..verbose = verbose
- ..fileSystem = fileSystem
- ..onDiagnostic = onDiagnostic
- ..verbosity = verbosity;
- Uri resolvedUri = options.compilationTarget;
- bool isLegacy = await fe.uriUsesLegacyLanguageVersion(resolvedUri, feOptions);
- _inferNullSafetyMode(options, !isLegacy);
+ // If we are passed a list of sources, then we are performing a modular
+ // compile. In this case, we cannot infer null safety from the source files
+ // and must instead rely on the options passed in on the command line.
+ bool isModularCompile = false;
+ List<Uri> sources = [];
+ if (options.sources != null) {
+ isModularCompile = true;
+ sources.addAll(options.sources);
+ } else {
+ fe.CompilerOptions feOptions = fe.CompilerOptions()
+ ..target = target
+ ..librariesSpecificationUri = options.librariesSpecificationUri
+ ..packagesFileUri = options.packageConfig
+ ..explicitExperimentalFlags = options.explicitExperimentalFlags
+ ..verbose = verbose
+ ..fileSystem = fileSystem
+ ..onDiagnostic = onDiagnostic
+ ..verbosity = verbosity;
+ Uri resolvedUri = options.compilationTarget;
+ bool isLegacy =
+ await fe.uriUsesLegacyLanguageVersion(resolvedUri, feOptions);
+ _inferNullSafetyMode(options, !isLegacy);
+ sources.add(options.compilationTarget);
+ }
+
+ // If we are performing a modular compile, we expect the platform binary to be
+ // supplied along with other dill dependencies.
List<Uri> dependencies = [];
- if (options.platformBinaries != null) {
+ if (options.platformBinaries != null && !isModularCompile) {
dependencies.add(options.platformBinaries
.resolve(_getPlatformFilename(options, targetName)));
}
@@ -248,10 +268,17 @@
options.useLegacySubtyping ? fe.NnbdMode.Weak : fe.NnbdMode.Strong,
invocationModes: options.cfeInvocationModes,
verbosity: verbosity);
- ir.Component component = await fe.compile(
- initializedCompilerState, verbose, fileSystem, onDiagnostic, resolvedUri);
+ ir.Component component = await fe.compile(initializedCompilerState, verbose,
+ fileSystem, onDiagnostic, sources, isModularCompile);
_validateNullSafetyMode(options);
- return _LoadFromSourceResult(component, initializedCompilerState);
+
+ // We have to compute canonical names on the component here to avoid missing
+ // canonical names downstream.
+ if (isModularCompile) {
+ component.computeCanonicalNames();
+ }
+ return _LoadFromSourceResult(
+ component, initializedCompilerState, isModularCompile ? sources : []);
}
Output _createOutput(
@@ -336,6 +363,7 @@
reporter, input.initializedCompilerState, targetName);
component = result.component;
initializedCompilerState = result.initializedCompilerState;
+ moduleLibraries = result.moduleLibraries;
}
if (component == null) return null;
if (input.forceSerialization) {
diff --git a/pkg/compiler/test/end_to_end/no_platform_test.dart b/pkg/compiler/test/end_to_end/no_platform_test.dart
index 00578fc..e786f3f 100644
--- a/pkg/compiler/test/end_to_end/no_platform_test.dart
+++ b/pkg/compiler/test/end_to_end/no_platform_test.dart
@@ -30,7 +30,8 @@
(fe.DiagnosticMessage message) {
message.plainTextFormatted.forEach(print);
Expect.notEquals(fe.Severity.error, message.severity);
- }, Uri.base.resolve('pkg/compiler/test/end_to_end/data/hello_world.dart'));
+ }, [Uri.base.resolve('pkg/compiler/test/end_to_end/data/hello_world.dart')],
+ false);
Expect.isNotNull(new ir.CoreTypes(component).futureClass);
}
diff --git a/pkg/compiler/test/end_to_end/trim_component_test.dart b/pkg/compiler/test/end_to_end/trim_component_test.dart
new file mode 100644
index 0000000..3673cbf
--- /dev/null
+++ b/pkg/compiler/test/end_to_end/trim_component_test.dart
@@ -0,0 +1,102 @@
+// Copyright (c) 2022, 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 'package:kernel/ast.dart' as ir;
+import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder;
+import '../helpers/memory_compiler.dart';
+
+const memorySourceFiles = const {
+ 'main.dart': '''
+// @dart=2.12
+import 'used.dart';
+
+void main() {
+ foo();
+}
+
+''',
+ 'used.dart': '''
+// @dart=2.12
+
+void foo() {
+ print('foo');
+}
+''',
+ 'unused.dart': '''
+// @dart=2.12
+
+void unused() {
+ throw 'unused';
+}
+'''
+};
+
+void verifyComponent(
+ ir.Component component, List<String> included, List<String> excluded) {
+ Set<String> uris = {};
+ component.libraries
+ .forEach((library) => uris.add(library.importUri.toString()));
+ for (String include in included) {
+ Expect.isTrue(uris.contains(include));
+ }
+ for (String exclude in excluded) {
+ Expect.isFalse(uris.contains(exclude));
+ }
+}
+
+Future<List<int>> buildDillAndVerify(
+ Map<String, dynamic> memorySourceFiles,
+ List<String> flags,
+ List<String> includedLibraries,
+ List<String> excludedLibraries) async {
+ final dillUri = Uri.parse('out.dill');
+ final collector = OutputCollector();
+ CompilationResult result = await runCompiler(
+ memorySourceFiles: memorySourceFiles,
+ options: flags,
+ outputProvider: collector);
+ Expect.isTrue(result.isSuccess);
+ Expect.isTrue(collector.binaryOutputMap.containsKey(dillUri));
+ List<int> bytes = collector.binaryOutputMap[dillUri].list;
+ Expect.isTrue(bytes.isNotEmpty);
+ ir.Component component = ir.Component();
+ BinaryBuilder(bytes).readComponent(component);
+ verifyComponent(component, includedLibraries, excludedLibraries);
+ return bytes;
+}
+
+void verifyComponentTrim() async {
+ List<String> buildDillFromSourceFlags = [
+ '--cfe-only',
+ '--out=out.dill',
+ '--sources=memory:main.dart,memory:used.dart,memory:unused.dart',
+ '--sound-null-safety',
+ ];
+ List<int> bytes = await buildDillAndVerify(
+ memorySourceFiles,
+ buildDillFromSourceFlags,
+ ['memory:main.dart', 'memory:used.dart', 'memory:unused.dart'],
+ []);
+
+ // The combination of `--cfe-only` + `--entry-uri` should trigger the
+ // component trimming logic.
+ List<String> trimDillFlags = [
+ '--input-dill=memory:main.dill',
+ '--cfe-only',
+ '--out=out.dill',
+ '--entry-uri=main.dart',
+ '--sound-null-safety',
+ ];
+ List<int> newBytes = await buildDillAndVerify(
+ {'main.dill': bytes},
+ trimDillFlags,
+ ['memory:main.dart', 'memory:used.dart'],
+ ['memory:unused.dart']);
+ Expect.isTrue(newBytes.length < bytes.length);
+}
+
+void main() async {
+ await verifyComponentTrim();
+}
diff --git a/pkg/compiler/test/model/in_user_code_test.dart b/pkg/compiler/test/model/in_user_code_test.dart
deleted file mode 100644
index 81bee9c..0000000
--- a/pkg/compiler/test/model/in_user_code_test.dart
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2014, 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.7
-
-// Test that the helper [Compiler.inUserCode] works as intended.
-
-import 'dart:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/compiler.dart' show Compiler;
-import '../helpers/memory_compiler.dart';
-
-const SOURCE = const {
- 'main.dart': """
-library main;
-
-import 'dart:async';
-import 'foo.dart';
-import 'pkg/sub/bar.dart';
-import 'package:sub/bar.dart';
-import 'package:sup/boz.dart';
-
-main() {}
-""",
- 'foo.dart': """
-library foo;
-""",
- 'pkg/sub/bar.dart': """
-library sub.bar;
-
-import 'package:sup/boz.dart';
-import 'baz.dart';
-
-main() {}
-""",
- 'pkg/sub/baz.dart': """
-library sub.baz;
-""",
- 'pkg/sup/boz.dart': """
-library sup.boz;
-""",
- '.packages': """
-sub:pkg/sub/
-sup:pkg/sup/
-"""
-};
-
-Future test(Uri entryPoint, Map<String, bool> expectedResults) async {
- print("Test: $entryPoint");
- CompilationResult result = await runCompiler(
- entryPoint: entryPoint,
- memorySourceFiles: SOURCE,
- packageConfig: Uri.parse('memory:.packages'));
- Compiler compiler = result.compiler;
- expectedResults.forEach((String uri, bool expectedResult) {
- dynamic element = compiler.frontendStrategy.elementEnvironment
- .lookupLibrary(Uri.parse(uri));
- Expect.isNotNull(element, "Unknown library '$uri'.");
- Expect.equals(
- expectedResult,
- compiler.inUserCode(element),
- expectedResult
- ? "Library '$uri' expected to be in user code"
- : "Library '$uri' not expected to be in user code");
- });
-}
-
-void main() {
- asyncTest(runTests);
-}
-
-Future runTests() async {
- await test(Uri.parse('memory:main.dart'), {
- 'memory:main.dart': true,
- 'memory:foo.dart': true,
- 'memory:pkg/sub/bar.dart': true,
- 'memory:pkg/sub/baz.dart': true,
- 'package:sub/bar.dart': false,
- 'package:sub/baz.dart': false,
- 'package:sup/boz.dart': false,
- 'dart:core': false,
- 'dart:async': false
- });
- await test(Uri.parse('package:sub/bar.dart'), {
- 'package:sub/bar.dart': true,
- 'package:sub/baz.dart': true,
- 'package:sup/boz.dart': false,
- 'dart:core': false
- });
-}
diff --git a/pkg/compiler/tool/modular_test_suite.dart b/pkg/compiler/tool/modular_test_suite.dart
index cf0d52c..5730ad6 100644
--- a/pkg/compiler/tool/modular_test_suite.dart
+++ b/pkg/compiler/tool/modular_test_suite.dart
@@ -21,7 +21,8 @@
options,
IOPipeline([
OutlineDillCompilationStep(),
- FullDillCompilationStep(),
+ FullDillCompilationStep(onlyOnSdk: true),
+ ModularAnalysisStep(onlyOnSdk: true),
ModularAnalysisStep(),
ConcatenateDillsStep(useModularAnalysis: true),
ComputeClosedWorldStep(useModularAnalysis: true),
diff --git a/pkg/compiler/tool/modular_test_suite_helper.dart b/pkg/compiler/tool/modular_test_suite_helper.dart
index 357b1da..7398c3d 100644
--- a/pkg/compiler/tool/modular_test_suite_helper.dart
+++ b/pkg/compiler/tool/modular_test_suite_helper.dart
@@ -51,10 +51,95 @@
return '{${fields.join(',')}}';
}
-abstract class CFEStep implements IOModularStep {
+String getRootScheme(Module module) {
+ // We use non file-URI schemes for representeing source locations in a
+ // root-agnostic way. This allows us to refer to file across modules and
+ // across steps without exposing the underlying temporary folders that are
+ // created by the framework. In build systems like bazel this is especially
+ // important because each step may be run on a different machine.
+ //
+ // Files in packages are defined in terms of `package:` URIs, while
+ // non-package URIs are defined using the `dart-dev-app` scheme.
+ return module.isSdk ? 'dart-dev-sdk' : 'dev-dart-app';
+}
+
+String sourceToImportUri(Module module, Uri relativeUri) {
+ if (module.isPackage) {
+ var basePath = module.packageBase.path;
+ var packageRelativePath = basePath == "./"
+ ? relativeUri.path
+ : relativeUri.path.substring(basePath.length);
+ return 'package:${module.name}/$packageRelativePath';
+ } else {
+ return '${getRootScheme(module)}:/$relativeUri';
+ }
+}
+
+List<String> getSources(Module module) {
+ return module.sources.map((uri) => sourceToImportUri(module, uri)).toList();
+}
+
+void writePackageConfig(
+ Module module, Set<Module> transitiveDependencies, Uri root) async {
+ // TODO(joshualitt): Figure out a way to support package configs in
+ // tests/modular.
+ var packageConfig = await loadPackageConfigUri(packageConfigUri);
+
+ // We create both a .packages and package_config.json file which defines
+ // the location of this module if it is a package. The CFE requires that
+ // if a `package:` URI of a dependency is used in an import, then we need
+ // that package entry in the associated file. However, after it checks that
+ // the definition exists, the CFE will not actually use the resolved URI if
+ // a library for the import URI is already found in one of the provide
+ // .dill files of the dependencies. For that reason, and to ensure that
+ // a step only has access to the files provided in a module, we generate a
+ // config file with invalid folders for other packages.
+ // TODO(sigmund): follow up with the CFE to see if we can remove the need
+ // for these dummy entries..
+ // TODO(joshualitt): Generate just the json file.
+ var packagesJson = [];
+ var packagesContents = StringBuffer();
+ if (module.isPackage) {
+ packagesContents.write('${module.name}:${module.packageBase}\n');
+ packagesJson.add(_packageConfigEntry(
+ module.name, Uri.parse('../${module.packageBase}')));
+ }
+
+ int unusedNum = 0;
+ for (Module dependency in transitiveDependencies) {
+ if (dependency.isPackage) {
+ // rootUri should be ignored for dependent modules, so we pass in a
+ // bogus value.
+ var rootUri = Uri.parse('unused$unusedNum');
+ unusedNum++;
+
+ var dependentPackage = packageConfig[dependency.name];
+ var packageJson = dependentPackage == null
+ ? _packageConfigEntry(dependency.name, rootUri)
+ : _packageConfigEntry(dependentPackage.name, rootUri,
+ version: dependentPackage.languageVersion);
+ packagesJson.add(packageJson);
+ packagesContents.write('${dependency.name}:$rootUri\n');
+ }
+ }
+
+ if (module.isPackage) {
+ await File.fromUri(root.resolve(packageConfigJsonPath))
+ .create(recursive: true);
+ await File.fromUri(root.resolve(packageConfigJsonPath)).writeAsString('{'
+ ' "configVersion": ${packageConfig.version},'
+ ' "packages": [ ${packagesJson.join(',')} ]'
+ '}');
+ }
+
+ await File.fromUri(root.resolve('.packages'))
+ .writeAsString('$packagesContents');
+}
+
+abstract class CFEStep extends IOModularStep {
final String stepName;
- CFEStep(this.stepName);
+ CFEStep(this.stepName, this.onlyOnSdk);
@override
bool get needsSources => true;
@@ -63,86 +148,17 @@
bool get onlyOnMain => false;
@override
+ final bool onlyOnSdk;
+
+ @override
Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
List<String> flags) async {
if (_options.verbose) print("\nstep: $stepName on $module");
- // TODO(joshualitt): Figure out a way to support package configs in
- // tests/modular.
- var packageConfig = await loadPackageConfigUri(packageConfigUri);
-
- // We use non file-URI schemes for representeing source locations in a
- // root-agnostic way. This allows us to refer to file across modules and
- // across steps without exposing the underlying temporary folders that are
- // created by the framework. In build systems like bazel this is especially
- // important because each step may be run on a different machine.
- //
- // Files in packages are defined in terms of `package:` URIs, while
- // non-package URIs are defined using the `dart-dev-app` scheme.
- String rootScheme = module.isSdk ? 'dart-dev-sdk' : 'dev-dart-app';
- String sourceToImportUri(Uri relativeUri) {
- if (module.isPackage) {
- var basePath = module.packageBase.path;
- var packageRelativePath = basePath == "./"
- ? relativeUri.path
- : relativeUri.path.substring(basePath.length);
- return 'package:${module.name}/$packageRelativePath';
- } else {
- return '$rootScheme:/$relativeUri';
- }
- }
-
- // We create both a .packages and package_config.json file which defines
- // the location of this module if it is a package. The CFE requires that
- // if a `package:` URI of a dependency is used in an import, then we need
- // that package entry in the associated file. However, after it checks that
- // the definition exists, the CFE will not actually use the resolved URI if
- // a library for the import URI is already found in one of the provide
- // .dill files of the dependencies. For that reason, and to ensure that
- // a step only has access to the files provided in a module, we generate a
- // config file with invalid folders for other packages.
- // TODO(sigmund): follow up with the CFE to see if we can remove the need
- // for these dummy entries..
- // TODO(joshualitt): Generate just the json file.
- var packagesJson = [];
- var packagesContents = StringBuffer();
- if (module.isPackage) {
- packagesContents.write('${module.name}:${module.packageBase}\n');
- packagesJson.add(_packageConfigEntry(
- module.name, Uri.parse('../${module.packageBase}')));
- }
-
Set<Module> transitiveDependencies = computeTransitiveDependencies(module);
- int unusedNum = 0;
- for (Module dependency in transitiveDependencies) {
- if (dependency.isPackage) {
- // rootUri should be ignored for dependent modules, so we pass in a
- // bogus value.
- var rootUri = Uri.parse('unused$unusedNum');
- unusedNum++;
+ writePackageConfig(module, transitiveDependencies, root);
- var dependentPackage = packageConfig[dependency.name];
- var packageJson = dependentPackage == null
- ? _packageConfigEntry(dependency.name, rootUri)
- : _packageConfigEntry(dependentPackage.name, rootUri,
- version: dependentPackage.languageVersion);
- packagesJson.add(packageJson);
- packagesContents.write('${dependency.name}:$rootUri\n');
- }
- }
-
- if (module.isPackage) {
- await File.fromUri(root.resolve(packageConfigJsonPath))
- .create(recursive: true);
- await File.fromUri(root.resolve(packageConfigJsonPath)).writeAsString('{'
- ' "configVersion": ${packageConfig.version},'
- ' "packages": [ ${packagesJson.join(',')} ]'
- '}');
- }
-
- await File.fromUri(root.resolve('.packages'))
- .writeAsString('$packagesContents');
-
+ String rootScheme = getRootScheme(module);
List<String> sources;
List<String> extraArgs = ['--packages-file', '$rootScheme:/.packages'];
if (module.isSdk) {
@@ -165,7 +181,7 @@
];
assert(transitiveDependencies.isEmpty);
} else {
- sources = module.sources.map(sourceToImportUri).toList();
+ sources = getSources(module);
}
// TODO(joshualitt): Ensure the kernel worker has some way to specify
@@ -228,7 +244,7 @@
@override
DataId get outputData => dillSummaryId;
- OutlineDillCompilationStep() : super('outline-dill-compilation');
+ OutlineDillCompilationStep() : super('outline-dill-compilation', false);
}
// Step that compiles sources in a module to a .dill file.
@@ -255,42 +271,81 @@
@override
DataId get outputData => dillId;
- FullDillCompilationStep() : super('full-dill-compilation');
+ FullDillCompilationStep({bool onlyOnSdk = false})
+ : super('full-dill-compilation', onlyOnSdk);
}
-class ModularAnalysisStep implements IOModularStep {
+class ModularAnalysisStep extends IOModularStep {
@override
- List<DataId> get resultData => const [modularDataId, modularUpdatedDillId];
+ List<DataId> get resultData => [modularDataId, modularUpdatedDillId];
@override
- bool get needsSources => false;
+ bool get needsSources => !onlyOnSdk;
+ /// The SDK has no dependencies, and for all other modules we only need
+ /// summaries.
@override
- List<DataId> get dependencyDataNeeded => const [dillId];
+ List<DataId> get dependencyDataNeeded => [dillSummaryId];
+ /// All non SDK modules only need sources for module data.
@override
- List<DataId> get moduleDataNeeded => const [dillId];
+ List<DataId> get moduleDataNeeded => onlyOnSdk ? [dillId] : const [];
@override
bool get onlyOnMain => false;
@override
+ final bool onlyOnSdk;
+
+ @override
+ bool get notOnSdk => !onlyOnSdk;
+
+ // TODO(joshualitt): We currently special case the SDK both because it is not
+ // trivial to build it in the same fashion as other modules, and because it is
+ // a special case in other build environments. Eventually, we should
+ // standardize this a bit more and always build the SDK modularly, if we have
+ // to build it.
+ ModularAnalysisStep({this.onlyOnSdk = false});
+
+ @override
Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
List<String> flags) async {
if (_options.verbose) print("\nstep: modular analysis on $module");
Set<Module> transitiveDependencies = computeTransitiveDependencies(module);
- Iterable<String> dillDependencies =
- transitiveDependencies.map((m) => '${toUri(m, dillId)}');
+ List<String> dillDependencies = [];
+ List<String> sources = [];
+ List<String> extraArgs = [];
+ if (!module.isSdk) {
+ writePackageConfig(module, transitiveDependencies, root);
+ String rootScheme = getRootScheme(module);
+ sources = getSources(module);
+ dillDependencies = transitiveDependencies
+ .map((m) => '${toUri(m, dillSummaryId)}')
+ .toList();
+ extraArgs = [
+ '--packages=${root.resolve('.packages')}',
+ '--multi-root=$root',
+ '--multi-root-scheme=$rootScheme',
+ ];
+ }
+
List<String> args = [
'--packages=${sdkRoot.toFilePath()}/.packages',
_dart2jsScript,
+ '--no-sound-null-safety',
if (_options.useSdk) '--libraries-spec=$_librarySpecForSnapshot',
- '${Flags.inputDill}=${toUri(module, dillId)}',
+ // If we have sources, then we aren't building the SDK, otherwise we
+ // assume we are building the sdk and pass in a full dill.
+ if (sources.isNotEmpty)
+ '${Flags.sources}=${sources.join(',')}'
+ else
+ '${Flags.inputDill}=${toUri(module, dillId)}',
if (dillDependencies.isNotEmpty)
'--dill-dependencies=${dillDependencies.join(',')}',
'--out=${toUri(module, modularUpdatedDillId)}',
'${Flags.writeModularAnalysis}=${toUri(module, modularDataId)}',
for (String flag in flags) '--enable-experiment=$flag',
+ ...extraArgs
];
var result =
await _runProcess(Platform.resolvedExecutable, args, root.toFilePath());
@@ -306,7 +361,7 @@
}
}
-class ConcatenateDillsStep implements IOModularStep {
+class ConcatenateDillsStep extends IOModularStep {
final bool useModularAnalysis;
DataId get idForDill => useModularAnalysis ? modularUpdatedDillId : dillId;
@@ -368,7 +423,7 @@
}
// Step that invokes the dart2js closed world computation.
-class ComputeClosedWorldStep implements IOModularStep {
+class ComputeClosedWorldStep extends IOModularStep {
final bool useModularAnalysis;
ComputeClosedWorldStep({this.useModularAnalysis});
@@ -429,7 +484,7 @@
}
// Step that runs the dart2js modular analysis.
-class GlobalAnalysisStep implements IOModularStep {
+class GlobalAnalysisStep extends IOModularStep {
@override
List<DataId> get resultData => const [globalDataId];
@@ -479,7 +534,7 @@
// 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.
-class Dart2jsCodegenStep implements IOModularStep {
+class Dart2jsCodegenStep extends IOModularStep {
final ShardDataId codeId;
Dart2jsCodegenStep(this.codeId);
@@ -531,7 +586,7 @@
// Step that invokes the dart2js codegen enqueuer and emitter on the main module
// given the results of the global analysis step and codegen shards.
-class Dart2jsEmissionStep implements IOModularStep {
+class Dart2jsEmissionStep extends IOModularStep {
@override
List<DataId> get resultData => const [jsId];
@@ -583,7 +638,7 @@
}
/// Step that runs the output of dart2js in d8 and saves the output.
-class RunD8 implements IOModularStep {
+class RunD8 extends IOModularStep {
@override
List<DataId> get resultData => const [txtId];
diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart
index bd0d2d8..077f5e1 100644
--- a/pkg/dev_compiler/lib/src/kernel/compiler.dart
+++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart
@@ -1327,23 +1327,7 @@
var fields = c.fields
.where((f) => f.isStatic && !isRedirectingFactoryField(f))
.toList();
- if (c.isEnum) {
- // We know enum fields can be safely emitted as const fields, as long
- // as the `values` field is emitted last.
- var classRef = _emitTopLevelName(c);
- var valueField = fields.firstWhere((f) => f.name.text == 'values');
- fields.remove(valueField);
- fields.add(valueField);
- for (var f in fields) {
- assert(f.isConst);
- body.add(defineValueOnClass(
- c,
- classRef,
- _emitStaticMemberName(f.name.text),
- _visitInitializer(f.initializer, f.annotations))
- .toStatement());
- }
- } else if (fields.isNotEmpty) {
+ if (fields.isNotEmpty) {
body.add(_emitLazyFields(_emitTopLevelName(c), fields,
(n) => _emitStaticMemberName(n.name.text)));
}
diff --git a/pkg/dev_compiler/test/modular_suite.dart b/pkg/dev_compiler/test/modular_suite.dart
index 0df7a21..eb34432 100644
--- a/pkg/dev_compiler/test/modular_suite.dart
+++ b/pkg/dev_compiler/test/modular_suite.dart
@@ -73,6 +73,12 @@
bool get onlyOnMain => false;
@override
+ bool get onlyOnSdk => false;
+
+ @override
+ bool get notOnSdk => false;
+
+ @override
Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
List<String> flags) async {
if (_options.verbose) print('\nstep: source-to-dill on $module');
@@ -163,6 +169,12 @@
bool get onlyOnMain => false;
@override
+ bool get onlyOnSdk => false;
+
+ @override
+ bool get notOnSdk => false;
+
+ @override
Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
List<String> flags) async {
if (_options.verbose) print('\nstep: ddc on $module');
@@ -245,6 +257,12 @@
bool get onlyOnMain => true;
@override
+ bool get onlyOnSdk => false;
+
+ @override
+ bool get notOnSdk => false;
+
+ @override
Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
List<String> flags) async {
if (_options.verbose) print('\nstep: d8 on $module');
diff --git a/pkg/dev_compiler/test/modular_suite_nnbd.dart b/pkg/dev_compiler/test/modular_suite_nnbd.dart
index 4c7c3b0..4a1f559 100644
--- a/pkg/dev_compiler/test/modular_suite_nnbd.dart
+++ b/pkg/dev_compiler/test/modular_suite_nnbd.dart
@@ -73,6 +73,12 @@
bool get onlyOnMain => false;
@override
+ bool get onlyOnSdk => false;
+
+ @override
+ bool get notOnSdk => false;
+
+ @override
Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
List<String> flags) async {
if (_options.verbose) print('\nstep: source-to-dill on $module');
@@ -165,6 +171,12 @@
bool get onlyOnMain => false;
@override
+ bool get onlyOnSdk => false;
+
+ @override
+ bool get notOnSdk => false;
+
+ @override
Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
List<String> flags) async {
if (_options.verbose) print('\nstep: ddc on $module');
@@ -249,6 +261,12 @@
bool get onlyOnMain => true;
@override
+ bool get onlyOnSdk => false;
+
+ @override
+ bool get notOnSdk => false;
+
+ @override
Future<void> execute(Module module, Uri root, ModuleDataToRelativeUri toUri,
List<String> flags) async {
if (_options.verbose) print('\nstep: d8 on $module');
diff --git a/pkg/dev_compiler/tool/ddb b/pkg/dev_compiler/tool/ddb
index 8c9efe1..a44b20b 100755
--- a/pkg/dev_compiler/tool/ddb
+++ b/pkg/dev_compiler/tool/ddb
@@ -32,6 +32,10 @@
// Parse flags.
var parser = ArgParser(usageLineLength: 80)
+ ..addOption('arch',
+ abbr: 'a',
+ help: "Target platform's machine architecture.",
+ allowed: ['x64', 'arm64'])
..addOption('binary', abbr: 'b', help: 'Runtime binary path.')
..addOption('compile-vm-options',
help: 'DART_VM_OPTIONS for the compilation VM.')
@@ -106,6 +110,7 @@
printUsage();
exit(1);
}
+ var arch = options['arch'] as String;
var debug = options['debug'] as bool ||
options['observe'] as bool ||
options.wasParsed('vm-service-port');
@@ -213,8 +218,7 @@
}
var sdkRoot = p.dirname(p.dirname(ddcPath));
- var buildDir =
- p.join(sdkRoot, Platform.isMacOS ? 'xcodebuild' : 'out', 'ReleaseX64');
+ var buildDir = resolveBuildDir(sdkRoot, arch);
var requirePath = p.join(sdkRoot, 'third_party', 'requirejs');
var sdkOutlineDill = p.join(buildDir,
soundNullSafety ? 'ddc_outline_sound.dill' : 'ddc_outline.dill');
@@ -371,3 +375,44 @@
}
throw UnsupportedError('Unsupported platform.');
}
+
+/// Maps supported unames to supported architectures.
+final _resolvedUnames = {
+ 'arm64': 'arm64',
+ 'x86_64': 'x64',
+ 'x64': 'x64',
+};
+
+/// Returns the location of the Dart SDK's build directory.
+String resolveBuildDir(String sdkRoot, String architecture) {
+ String platformString;
+ String archString;
+ if (Platform.isMacOS) {
+ platformString = 'xcodebuild';
+ String resolvedArchitecture = architecture;
+ if (architecture == null) {
+ final uname = Process.runSync('uname', ['-m']).stdout.trim();
+ resolvedArchitecture = _resolvedUnames[uname] ?? uname;
+ }
+ if (resolvedArchitecture == 'x64') {
+ archString = 'ReleaseX64';
+ } else if (resolvedArchitecture == 'arm64') {
+ archString = 'ReleaseARM64';
+ } else {
+ throw UnsupportedError(
+ 'DDB does not currently support the architecture $architecture '
+ 'on MacOS.');
+ }
+ } else if (Platform.isLinux || Platform.isWindows) {
+ platformString = 'out';
+ if (architecture != null && architecture != 'x64') {
+ throw UnsupportedError(
+ 'DDB does not currently support the architecture $architecture '
+ 'on Windows or Linux.');
+ }
+ archString = 'ReleaseX64';
+ } else {
+ throw UnsupportedError('Unsupported platform.');
+ }
+ return p.join(sdkRoot, platformString, archString);
+}
diff --git a/pkg/front_end/lib/src/api_unstable/dart2js.dart b/pkg/front_end/lib/src/api_unstable/dart2js.dart
index 74fd203..014908f 100644
--- a/pkg/front_end/lib/src/api_unstable/dart2js.dart
+++ b/pkg/front_end/lib/src/api_unstable/dart2js.dart
@@ -172,7 +172,9 @@
bool verbose,
FileSystem fileSystem,
DiagnosticMessageHandler onDiagnostic,
- Uri input) async {
+ List<Uri> inputs,
+ bool isModularCompile) async {
+ assert(inputs.length == 1 || isModularCompile);
CompilerOptions options = state.options;
options
..onDiagnostic = onDiagnostic
@@ -181,7 +183,7 @@
ProcessedOptions processedOpts = state.processedOpts;
processedOpts.inputs.clear();
- processedOpts.inputs.add(input);
+ processedOpts.inputs.addAll(inputs);
processedOpts.clearFileSystemCache();
CompilerResult? compilerResult = await CompilerContext.runWithOptions(
@@ -189,9 +191,10 @@
CompilerResult compilerResult = await generateKernelInternal();
Component? component = compilerResult.component;
if (component == null) return null;
- if (component.mainMethod == null) {
+ if (component.mainMethod == null && !isModularCompile) {
context.options.report(
- messageMissingMain.withLocation(input, -1, 0), Severity.error);
+ messageMissingMain.withLocation(inputs.single, -1, 0),
+ Severity.error);
return null;
}
return compilerResult;
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 07a3764..80ca725 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -1854,7 +1854,6 @@
List<Expression>? positionalSuperParametersAsArguments;
List<NamedExpression>? namedSuperParametersAsArguments;
- Set<String>? namedSuperParameterNames;
if (formals != null) {
for (FormalParameterBuilder formal in formals) {
if (formal.isSuperInitializingFormal) {
@@ -1866,7 +1865,6 @@
forNullGuardedAccess: false)
..fileOffset = formal.charOffset)
..fileOffset = formal.charOffset);
- (namedSuperParameterNames ??= <String>{}).add(formal.name);
} else {
(positionalSuperParametersAsArguments ??= <Expression>[]).add(
new VariableGetImpl(formal.variable!,
@@ -1888,7 +1886,7 @@
superInitializer.fileOffset, noLength))
..parent = constructor;
} else if (libraryBuilder.enableSuperParametersInLibrary) {
- ArgumentsImpl arguments = superInitializer.arguments as ArgumentsImpl;
+ Arguments arguments = superInitializer.arguments;
if (positionalSuperParametersAsArguments != null) {
if (arguments.positional.isNotEmpty) {
@@ -1906,14 +1904,12 @@
} else {
arguments.positional.addAll(positionalSuperParametersAsArguments);
setParents(positionalSuperParametersAsArguments, arguments);
- arguments.positionalAreSuperParameters = true;
}
}
if (namedSuperParametersAsArguments != null) {
// TODO(cstefantsova): Report name conflicts.
arguments.named.addAll(namedSuperParametersAsArguments);
setParents(namedSuperParametersAsArguments, arguments);
- arguments.namedSuperParameterNames = namedSuperParameterNames;
}
}
} else if (initializers.last is RedirectingInitializer) {
@@ -1962,7 +1958,7 @@
/// >unless the enclosing class is class Object.
Constructor? superTarget = lookupConstructor(emptyName, isSuper: true);
Initializer initializer;
- ArgumentsImpl arguments;
+ Arguments arguments;
List<Expression>? positionalArguments;
List<NamedExpression>? namedArguments;
if (libraryBuilder.enableSuperParametersInLibrary) {
@@ -1980,7 +1976,6 @@
forNullGuardedAccess: false)
]);
}
-
if (positionalArguments != null || namedArguments != null) {
arguments = forest.createArguments(
noLocation, positionalArguments ?? <Expression>[],
@@ -1988,11 +1983,6 @@
} else {
arguments = forest.createArgumentsEmpty(noLocation);
}
-
- arguments.positionalAreSuperParameters =
- positionalSuperParametersAsArguments != null;
- arguments.namedSuperParameterNames = namedSuperParameterNames;
-
if (superTarget == null ||
checkArgumentsForFunction(superTarget.function, arguments,
builder.charOffset, const <TypeParameter>[]) !=
diff --git a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
index 3009ba1..354dddc 100644
--- a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
@@ -493,17 +493,6 @@
List<Object?>? argumentsOriginalOrder;
- /// True if the arguments are passed to the super-constructor in a
- /// super-initializer, and the positional parameters are super-initializer
- /// parameters. It is true that either all of the positional parameters are
- /// super-initializer parameters or none of them, so a simple boolean
- /// accurately reflects the state.
- bool positionalAreSuperParameters = false;
-
- /// Names of the named positional parameters. If none of the parameters are
- /// super-positional, the field is null.
- Set<String>? namedSuperParameterNames;
-
ArgumentsImpl.internal(
{required List<Expression> positional,
required List<DartType>? types,
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_helper.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_helper.dart
index 3fe267a..0a19850 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_helper.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_helper.dart
@@ -250,11 +250,13 @@
final Member original;
final Substitution substitution;
final bool copyReturnType;
+ bool _hasBeenInferred = false;
TypeDependency(this.synthesized, this.original, this.substitution,
{required this.copyReturnType});
void copyInferred() {
+ if (_hasBeenInferred) return;
for (int i = 0; i < original.function!.positionalParameters.length; i++) {
VariableDeclaration synthesizedParameter =
synthesized.function!.positionalParameters[i];
@@ -275,5 +277,6 @@
synthesized.function!.returnType =
substitution.substituteType(original.function!.returnType);
}
+ _hasBeenInferred = true;
}
}
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 d90e037..7912ac66 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -1088,11 +1088,11 @@
//..fileEndOffset = cls.fileOffset
..isNonNullableByDefault = cls.enclosingLibrary.isNonNullableByDefault;
+ TypeDependency? typeDependency;
if (hasTypeDependency) {
- loader.registerTypeDependency(
- constructor,
- new TypeDependency(constructor, superConstructor, substitution,
- copyReturnType: false));
+ typeDependency = new TypeDependency(
+ constructor, superConstructor, substitution,
+ copyReturnType: false);
}
Procedure? constructorTearOff = createConstructorTearOffProcedure(
@@ -1107,16 +1107,20 @@
buildConstructorTearOffProcedure(constructorTearOff, constructor,
classBuilder.cls, classBuilder.libraryBuilder);
}
- return new SyntheticSourceConstructorBuilder(
- classBuilder, constructor, constructorTearOff,
- // We pass on the original constructor and the cloned function nodes to
- // ensure that the default values are computed and cloned for the
- // outline. It is needed to make the default values a part of the
- // outline for const constructors, and additionally it is required for
- // a potential subclass using super initializing parameters that will
- // required the cloning of the default values.
- definingConstructor: superConstructorBuilder,
- delayedDefaultValueCloner: delayedDefaultValueCloner);
+ SyntheticSourceConstructorBuilder constructorBuilder =
+ new SyntheticSourceConstructorBuilder(
+ classBuilder, constructor, constructorTearOff,
+ // We pass on the original constructor and the cloned function nodes
+ // to ensure that the default values are computed and cloned for the
+ // outline. It is needed to make the default values a part of the
+ // outline for const constructors, and additionally it is required
+ // for a potential subclass using super initializing parameters that
+ // will required the cloning of the default values.
+ definingConstructor: superConstructorBuilder,
+ delayedDefaultValueCloner: delayedDefaultValueCloner,
+ typeDependency: typeDependency);
+ loader.registerConstructorToBeInferred(constructor, constructorBuilder);
+ return constructorBuilder;
}
void finishSynthesizedParameters({bool forOutline = false}) {
diff --git a/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart b/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
index 15e3b74..25777e5 100644
--- a/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
@@ -26,7 +26,8 @@
import '../kernel/constructor_tearoff_lowering.dart';
import '../kernel/expression_generator_helper.dart';
import '../kernel/hierarchy/class_member.dart' show ClassMember;
-import '../kernel/kernel_helper.dart' show DelayedDefaultValueCloner;
+import '../kernel/kernel_helper.dart'
+ show DelayedDefaultValueCloner, TypeDependency;
import '../kernel/utils.dart'
show isRedirectingGenerativeConstructorImplementation;
import '../messages.dart'
@@ -52,6 +53,9 @@
abstract class SourceConstructorBuilder
implements ConstructorBuilder, SourceMemberBuilder {
+ /// Infers the types of any untyped initializing formals.
+ void inferFormalTypes(TypeEnvironment typeEnvironment);
+
void addSuperParameterDefaultValueCloners(
List<DelayedDefaultValueCloner> delayedDefaultValueCloners);
}
@@ -224,7 +228,7 @@
return _constructor;
}
- /// Infers the types of any untyped initializing formals.
+ @override
void inferFormalTypes(TypeEnvironment typeEnvironment) {
if (_hasFormalsInferred) return;
if (formals != null) {
@@ -321,14 +325,8 @@
ConstructorBuilder? superTargetBuilder =
_computeSuperTargetBuilder(initializers);
- if (superTargetBuilder is DeclaredSourceConstructorBuilder) {
+ if (superTargetBuilder is SourceConstructorBuilder) {
superTargetBuilder.inferFormalTypes(typeEnvironment);
- } else if (superTargetBuilder is SyntheticSourceConstructorBuilder) {
- MemberBuilder? superTargetOriginBuilder =
- superTargetBuilder._effectivelyDefiningConstructor;
- if (superTargetOriginBuilder is DeclaredSourceConstructorBuilder) {
- superTargetOriginBuilder.inferFormalTypes(typeEnvironment);
- }
}
Constructor superTarget;
@@ -339,10 +337,9 @@
superFormals = superTargetBuilder.formals!;
} else if (superTargetBuilder is DillConstructorBuilder) {
superTarget = superTargetBuilder.constructor;
+ superConstructorFunction = superTargetBuilder.function;
if (superTargetBuilder is SyntheticSourceConstructorBuilder) {
superFormals = superTargetBuilder.formals;
- } else {
- superConstructorFunction = superTargetBuilder.function;
}
} else {
// The error in this case should be reported elsewhere. Here we perform a
@@ -354,7 +351,27 @@
List<bool> positionalSuperFormalHasInitializer = [];
Map<String, DartType?> namedSuperFormalType = {};
Map<String, bool> namedSuperFormalHasInitializer = {};
- if (superFormals != null) {
+ // TODO(johnniwinther): Clean this up when [VariableDeclaration] has a
+ // `hasDeclaredInitializer` flag.
+ if (superFormals != null && superConstructorFunction != null) {
+ for (VariableDeclaration formal
+ in superConstructorFunction.positionalParameters) {
+ positionalSuperFormalType.add(formal.type);
+ }
+ for (VariableDeclaration formal
+ in superConstructorFunction.namedParameters) {
+ namedSuperFormalType[formal.name!] = formal.type;
+ }
+ for (FormalParameterBuilder formal in superFormals) {
+ if (formal.isPositional) {
+ positionalSuperFormalHasInitializer
+ .add(formal.hasDeclaredInitializer);
+ } else {
+ namedSuperFormalHasInitializer[formal.name] =
+ formal.hasDeclaredInitializer;
+ }
+ }
+ } else if (superFormals != null) {
for (FormalParameterBuilder formal in superFormals) {
if (formal.isPositional) {
positionalSuperFormalType.add(formal.variable?.type);
@@ -802,19 +819,34 @@
/// the constructor that effectively defines this constructor.
MemberBuilder? _immediatelyDefiningConstructor;
DelayedDefaultValueCloner? _delayedDefaultValueCloner;
+ TypeDependency? _typeDependency;
SyntheticSourceConstructorBuilder(SourceClassBuilder parent,
Constructor constructor, Procedure? constructorTearOff,
{MemberBuilder? definingConstructor,
- DelayedDefaultValueCloner? delayedDefaultValueCloner})
+ DelayedDefaultValueCloner? delayedDefaultValueCloner,
+ TypeDependency? typeDependency})
: _immediatelyDefiningConstructor = definingConstructor,
_delayedDefaultValueCloner = delayedDefaultValueCloner,
+ _typeDependency = typeDependency,
super(constructor, constructorTearOff, parent);
@override
SourceLibraryBuilder get libraryBuilder =>
super.libraryBuilder as SourceLibraryBuilder;
+ @override
+ void inferFormalTypes(TypeEnvironment typeEnvironment) {
+ if (_immediatelyDefiningConstructor is SourceConstructorBuilder) {
+ (_immediatelyDefiningConstructor as SourceConstructorBuilder)
+ .inferFormalTypes(typeEnvironment);
+ }
+ if (_typeDependency != null) {
+ _typeDependency!.copyInferred();
+ _typeDependency = null;
+ }
+ }
+
MemberBuilder? get _effectivelyDefiningConstructor {
MemberBuilder? origin = _immediatelyDefiningConstructor;
while (origin is SyntheticSourceConstructorBuilder) {
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 084733a..280a71d 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -974,7 +974,7 @@
}
void registerConstructorToBeInferred(
- Constructor constructor, DeclaredSourceConstructorBuilder builder) {
+ Constructor constructor, SourceConstructorBuilder builder) {
_typeInferenceEngine!.toBeInferred[constructor] = builder;
}
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
index 3459623..0327d2c 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
@@ -113,14 +113,14 @@
/// This is represented as a map from a constructor to its library
/// builder because the builder is used to report errors due to cyclic
/// inference dependencies.
- final Map<Constructor, DeclaredSourceConstructorBuilder> toBeInferred = {};
+ final Map<Constructor, SourceConstructorBuilder> toBeInferred = {};
/// A map containing constructors in the process of being inferred.
///
/// This is used to detect cyclic inference dependencies. It is represented
/// as a map from a constructor to its library builder because the builder
/// is used to report errors.
- final Map<Constructor, DeclaredSourceConstructorBuilder> beingInferred = {};
+ final Map<Constructor, SourceConstructorBuilder> beingInferred = {};
final Map<Member, TypeDependency> typeDependencies = {};
@@ -144,7 +144,7 @@
void finishTopLevelInitializingFormals() {
// Field types have all been inferred so we don't need to guard against
// cyclic dependency.
- for (DeclaredSourceConstructorBuilder builder in toBeInferred.values) {
+ for (SourceConstructorBuilder builder in toBeInferred.values) {
builder.inferFormalTypes(typeSchemaEnvironment);
}
toBeInferred.clear();
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 8dbfdac..a0e094b 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
@@ -388,8 +388,7 @@
@override
void inferConstructorParameterTypes(Constructor target) {
- DeclaredSourceConstructorBuilder? constructor =
- engine.beingInferred[target];
+ SourceConstructorBuilder? constructor = engine.beingInferred[target];
if (constructor != null) {
// There is a cyclic dependency where inferring the types of the
// initializing formals of a constructor required us to infer the
@@ -494,7 +493,6 @@
DartType? declaredContextType,
DartType? runtimeCheckedType,
bool isVoidAllowed: false,
- bool coerceExpression: true,
Template<Message Function(DartType, DartType, bool)>? errorTemplate,
Template<Message Function(DartType, DartType, bool)>?
nullabilityErrorTemplate,
@@ -510,7 +508,6 @@
declaredContextType: declaredContextType,
runtimeCheckedType: runtimeCheckedType,
isVoidAllowed: isVoidAllowed,
- coerceExpression: coerceExpression,
errorTemplate: errorTemplate,
nullabilityErrorTemplate: nullabilityErrorTemplate,
nullabilityNullErrorTemplate: nullabilityNullErrorTemplate,
@@ -529,7 +526,6 @@
DartType? declaredContextType,
DartType? runtimeCheckedType,
bool isVoidAllowed: false,
- bool coerceExpression: true,
Template<Message Function(DartType, DartType, bool)>? errorTemplate,
Template<Message Function(DartType, DartType, bool)>?
nullabilityErrorTemplate,
@@ -581,8 +577,7 @@
contextType, inferenceResult.inferredType,
isNonNullableByDefault: isNonNullableByDefault,
isVoidAllowed: isVoidAllowed,
- isExpressionTypePrecise: preciseTypeErrorTemplate != null,
- coerceExpression: coerceExpression);
+ isExpressionTypePrecise: preciseTypeErrorTemplate != null);
if (assignabilityResult.needsTearOff) {
TypedTearoff typedTearoff = _tearOffCall(inferenceResult.expression,
@@ -786,8 +781,7 @@
DartType contextType, DartType expressionType,
{required bool isNonNullableByDefault,
required bool isVoidAllowed,
- required bool isExpressionTypePrecise,
- required bool coerceExpression}) {
+ required bool isExpressionTypePrecise}) {
// ignore: unnecessary_null_comparison
assert(isNonNullableByDefault != null);
// ignore: unnecessary_null_comparison
@@ -799,7 +793,7 @@
// should tear off `.call`.
// TODO(paulberry): use resolveTypeParameter. See findInterfaceMember.
bool needsTearoff = false;
- if (coerceExpression && expressionType is InterfaceType) {
+ if (expressionType is InterfaceType) {
Class classNode = expressionType.classNode;
Member? callMember =
classHierarchy.getInterfaceMember(classNode, callName);
@@ -818,7 +812,7 @@
}
}
ImplicitInstantiation? implicitInstantiation;
- if (coerceExpression && libraryBuilder.enableConstructorTearOffsInLibrary) {
+ if (libraryBuilder.enableConstructorTearOffsInLibrary) {
implicitInstantiation =
computeImplicitInstantiation(expressionType, contextType);
if (implicitInstantiation != null) {
@@ -872,15 +866,8 @@
return const AssignabilityResult(AssignabilityKind.unassignablePrecise,
needsTearOff: false);
}
-
- if (coerceExpression) {
- // Insert an implicit downcast.
- return new AssignabilityResult(AssignabilityKind.assignableCast,
- needsTearOff: needsTearoff,
- implicitInstantiation: implicitInstantiation);
- }
-
- return new AssignabilityResult(AssignabilityKind.unassignable,
+ // Insert an implicit downcast.
+ return new AssignabilityResult(AssignabilityKind.assignableCast,
needsTearOff: needsTearoff,
implicitInstantiation: implicitInstantiation);
}
@@ -2630,23 +2617,17 @@
DartType actualType = actualTypes![i];
Expression expression;
NamedExpression? namedExpression;
- bool coerceExpression;
if (i < numPositionalArgs) {
expression = arguments.positional[positionalShift + i];
positionalArgumentTypes.add(actualType);
- coerceExpression = !arguments.positionalAreSuperParameters;
} else {
namedExpression = arguments.named[i - numPositionalArgs];
expression = namedExpression.value;
namedArgumentTypes
.add(new NamedType(namedExpression.name, actualType));
- coerceExpression = !(arguments.namedSuperParameterNames
- ?.contains(namedExpression.name) ??
- false);
}
expression = ensureAssignable(expectedType, actualType, expression,
isVoidAllowed: expectedType is VoidType,
- coerceExpression: coerceExpression,
// TODO(johnniwinther): Specialize message for operator
// invocations.
errorTemplate: templateArgumentTypeNotAssignable,
diff --git a/pkg/front_end/test/spell_checking_list_common.txt b/pkg/front_end/test/spell_checking_list_common.txt
index c09bea1..1d062f6 100644
--- a/pkg/front_end/test/spell_checking_list_common.txt
+++ b/pkg/front_end/test/spell_checking_list_common.txt
@@ -47,7 +47,6 @@
accounted
accumulate
accurate
-accurately
achieve
act
acting
@@ -490,7 +489,6 @@
closures
clue
code
-coerce
coincides
coinductively
collapses
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart b/pkg/front_end/testcases/super_parameters/issue48708.dart
new file mode 100644
index 0000000..5b2395d
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2022, 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 Mixin {}
+
+abstract class B<D> {
+ B({
+ required this.field,
+ });
+
+ final D field;
+}
+
+class C extends B<A> with Mixin {
+ C({
+ required super.field,
+ });
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart.strong.expect b/pkg/front_end/testcases/super_parameters/issue48708.dart.strong.expect
new file mode 100644
index 0000000..05ade25
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart.strong.expect
@@ -0,0 +1,35 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class Mixin extends core::Object {
+ synthetic constructor •() → self::Mixin
+ : super core::Object::•()
+ ;
+}
+abstract class B<D extends core::Object? = dynamic> extends core::Object {
+ final field self::B::D% field;
+ constructor •({required self::B::D% field = #C1}) → self::B<self::B::D%>
+ : self::B::field = field, super core::Object::•()
+ ;
+}
+abstract class _C&B&Mixin = self::B<self::A> with self::Mixin /*isAnonymousMixin*/ {
+ synthetic constructor •({self::A field = #C1}) → self::_C&B&Mixin
+ : super self::B::•(field: field)
+ ;
+}
+class C extends self::_C&B&Mixin {
+ constructor •({required self::A field = #C1}) → self::C
+ : super self::_C&B&Mixin::•(field: field)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart.strong.transformed.expect b/pkg/front_end/testcases/super_parameters/issue48708.dart.strong.transformed.expect
new file mode 100644
index 0000000..f71d862
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart.strong.transformed.expect
@@ -0,0 +1,35 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class Mixin extends core::Object {
+ synthetic constructor •() → self::Mixin
+ : super core::Object::•()
+ ;
+}
+abstract class B<D extends core::Object? = dynamic> extends core::Object {
+ final field self::B::D% field;
+ constructor •({required self::B::D% field = #C1}) → self::B<self::B::D%>
+ : self::B::field = field, super core::Object::•()
+ ;
+}
+abstract class _C&B&Mixin extends self::B<self::A> implements self::Mixin /*isAnonymousMixin,isEliminatedMixin*/ {
+ synthetic constructor •({self::A field = #C1}) → self::_C&B&Mixin
+ : super self::B::•(field: field)
+ ;
+}
+class C extends self::_C&B&Mixin {
+ constructor •({required self::A field = #C1}) → self::C
+ : super self::_C&B&Mixin::•(field: field)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart.textual_outline.expect b/pkg/front_end/testcases/super_parameters/issue48708.dart.textual_outline.expect
new file mode 100644
index 0000000..963c4ca
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart.textual_outline.expect
@@ -0,0 +1,18 @@
+class A {}
+
+class Mixin {}
+
+abstract class B<D> {
+ B({
+ required this.field,
+ });
+ final D field;
+}
+
+class C extends B<A> with Mixin {
+ C({
+ required super.field,
+ });
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/super_parameters/issue48708.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..429733e
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart.textual_outline_modelled.expect
@@ -0,0 +1,18 @@
+abstract class B<D> {
+ B({
+ required this.field,
+ });
+ final D field;
+}
+
+class A {}
+
+class C extends B<A> with Mixin {
+ C({
+ required super.field,
+ });
+}
+
+class Mixin {}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.expect b/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.expect
new file mode 100644
index 0000000..05ade25
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.expect
@@ -0,0 +1,35 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class Mixin extends core::Object {
+ synthetic constructor •() → self::Mixin
+ : super core::Object::•()
+ ;
+}
+abstract class B<D extends core::Object? = dynamic> extends core::Object {
+ final field self::B::D% field;
+ constructor •({required self::B::D% field = #C1}) → self::B<self::B::D%>
+ : self::B::field = field, super core::Object::•()
+ ;
+}
+abstract class _C&B&Mixin = self::B<self::A> with self::Mixin /*isAnonymousMixin*/ {
+ synthetic constructor •({self::A field = #C1}) → self::_C&B&Mixin
+ : super self::B::•(field: field)
+ ;
+}
+class C extends self::_C&B&Mixin {
+ constructor •({required self::A field = #C1}) → self::C
+ : super self::_C&B&Mixin::•(field: field)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.modular.expect b/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.modular.expect
new file mode 100644
index 0000000..05ade25
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.modular.expect
@@ -0,0 +1,35 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class Mixin extends core::Object {
+ synthetic constructor •() → self::Mixin
+ : super core::Object::•()
+ ;
+}
+abstract class B<D extends core::Object? = dynamic> extends core::Object {
+ final field self::B::D% field;
+ constructor •({required self::B::D% field = #C1}) → self::B<self::B::D%>
+ : self::B::field = field, super core::Object::•()
+ ;
+}
+abstract class _C&B&Mixin = self::B<self::A> with self::Mixin /*isAnonymousMixin*/ {
+ synthetic constructor •({self::A field = #C1}) → self::_C&B&Mixin
+ : super self::B::•(field: field)
+ ;
+}
+class C extends self::_C&B&Mixin {
+ constructor •({required self::A field = #C1}) → self::C
+ : super self::_C&B&Mixin::•(field: field)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.outline.expect b/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.outline.expect
new file mode 100644
index 0000000..4a28ead1
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.outline.expect
@@ -0,0 +1,28 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ ;
+}
+class Mixin extends core::Object {
+ synthetic constructor •() → self::Mixin
+ ;
+}
+abstract class B<D extends core::Object? = dynamic> extends core::Object {
+ final field self::B::D% field;
+ constructor •({required self::B::D% field}) → self::B<self::B::D%>
+ ;
+}
+abstract class _C&B&Mixin = self::B<self::A> with self::Mixin /*isAnonymousMixin*/ {
+ synthetic constructor •({self::A field}) → self::_C&B&Mixin
+ : super self::B::•(field: field)
+ ;
+}
+class C extends self::_C&B&Mixin {
+ constructor •({required self::A field}) → self::C
+ ;
+}
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.transformed.expect b/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.transformed.expect
new file mode 100644
index 0000000..f71d862
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/issue48708.dart.weak.transformed.expect
@@ -0,0 +1,35 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class Mixin extends core::Object {
+ synthetic constructor •() → self::Mixin
+ : super core::Object::•()
+ ;
+}
+abstract class B<D extends core::Object? = dynamic> extends core::Object {
+ final field self::B::D% field;
+ constructor •({required self::B::D% field = #C1}) → self::B<self::B::D%>
+ : self::B::field = field, super core::Object::•()
+ ;
+}
+abstract class _C&B&Mixin extends self::B<self::A> implements self::Mixin /*isAnonymousMixin,isEliminatedMixin*/ {
+ synthetic constructor •({self::A field = #C1}) → self::_C&B&Mixin
+ : super self::B::•(field: field)
+ ;
+}
+class C extends self::_C&B&Mixin {
+ constructor •({required self::A field = #C1}) → self::C
+ : super self::_C&B&Mixin::•(field: field)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart b/pkg/front_end/testcases/super_parameters/no_coercions.dart
deleted file mode 100644
index 942256b..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2022, 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 A1 {
- A1(int x);
-}
-
-class B1 extends A1 {
- B1.one(dynamic super.x); // Error.
- B1.two(dynamic super.x) : super(); // Error.
-}
-
-class A2 {
- A2({required String x});
-}
-
-class B2 extends A2 {
- B2.one({required dynamic super.x}); // Error.
- B2.two({required dynamic super.x}) : super(); // Error.
-}
-
-class A3 {
- A3(num Function(double) f);
-}
-
-class B3 extends A3 {
- B3.one(X Function<X>(double) super.f); // Error.
- B3.two(X Function<X>(double) super.f) : super(); // Error.
-}
-
-class A4 {
- A4({required num Function(double) f});
-}
-
-class B4 extends A4 {
- B4.one({required X Function<X>(double) super.f}); // Error.
- B4.two({required X Function<X>(double) super.f}) : super(); // Error.
-}
-
-abstract class C5 {
- String call(int x, num y);
-}
-
-class A5 {
- A5(String Function(int, num) f);
-}
-
-class B5 extends A5 {
- B5.one(C5 super.f); // Error.
- B5.two(C5 super.f) : super(); // Error.
-}
-
-class A6 {
- A6({required String Function(int, num) f});
-}
-
-class B6 extends A6 {
- B6.one({required C5 super.f}); // Error.
- B6.two({required C5 super.f}) : super(); // Error.
-}
-
-class A7 {
- A7({required int x1,
- required int x2,
- required bool Function(Object) f1,
- required bool Function(Object) f2,
- required void Function(dynamic) g1,
- required void Function(dynamic) g2});
-}
-
-class B7 extends A7 {
- B7({required dynamic super.x1, // Error.
- required dynamic x2,
- required X Function<X>(Object) super.f1, // Error.
- required X Function<X>(Object) f2,
- required void Function<X>(X) super.g1, // Error.
- required void Function<X>(X) g2}) :
- super(x2: x2, f2: f2, g2: g2); // Ok.
-}
-
-main() {}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.expect
deleted file mode 100644
index 1d154d8..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.expect
+++ /dev/null
@@ -1,206 +0,0 @@
-library /*isNonNullableByDefault*/;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.one(dynamic super.x); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.two(dynamic super.x) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.one({required dynamic super.x}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.two({required dynamic super.x}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.one(X Function<X>(double) super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.two(X Function<X>(double) super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.one({required X Function<X>(double) super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.one(C5 super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.two(C5 super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.one({required C5 super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.two({required C5 super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B7({required dynamic super.x1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
-// - 'Object' is from 'dart:core'.
-// required X Function<X>(Object) super.f1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
-// required void Function<X>(X) super.g1, // Error.
-// ^
-//
-import self as self;
-import "dart:core" as core;
-
-class A1 extends core::Object {
- constructor •(core::int x) → self::A1
- : super core::Object::•()
- ;
-}
-class B1 extends self::A1 {
- constructor one(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.one(dynamic super.x); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
- constructor two(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.two(dynamic super.x) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
-}
-class A2 extends core::Object {
- constructor •({required core::String x = #C1}) → self::A2
- : super core::Object::•()
- ;
-}
-class B2 extends self::A2 {
- constructor one({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.one({required dynamic super.x}); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
- constructor two({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.two({required dynamic super.x}) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
-}
-class A3 extends core::Object {
- constructor •((core::double) → core::num f) → self::A3
- : super core::Object::•()
- ;
-}
-class B3 extends self::A3 {
- constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.one(X Function<X>(double) super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.two(X Function<X>(double) super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-class A4 extends core::Object {
- constructor •({required (core::double) → core::num f = #C1}) → self::A4
- : super core::Object::•()
- ;
-}
-class B4 extends self::A4 {
- constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.one({required X Function<X>(double) super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.two({required X Function<X>(double) super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-abstract class C5 extends core::Object {
- synthetic constructor •() → self::C5
- : super core::Object::•()
- ;
- abstract method call(core::int x, core::num y) → core::String;
-}
-class A5 extends core::Object {
- constructor •((core::int, core::num) → core::String f) → self::A5
- : super core::Object::•()
- ;
-}
-class B5 extends self::A5 {
- constructor one(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.one(C5 super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.two(C5 super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A6 extends core::Object {
- constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
- : super core::Object::•()
- ;
-}
-class B6 extends self::A6 {
- constructor one({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.one({required C5 super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.two({required C5 super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A7 extends core::Object {
- constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
- : super core::Object::•()
- ;
-}
-class B7 extends self::A7 {
- constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
- : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B7({required dynamic super.x1, // Error.
- ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
- - 'Object' is from 'dart:core'.
- required X Function<X>(Object) super.f1, // Error.
- ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
- required void Function<X>(X) super.g1, // Error.
- ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
- ;
-}
-static method main() → dynamic {}
-
-constants {
- #C1 = null
-}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.transformed.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.transformed.expect
deleted file mode 100644
index 1d154d8..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.transformed.expect
+++ /dev/null
@@ -1,206 +0,0 @@
-library /*isNonNullableByDefault*/;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.one(dynamic super.x); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.two(dynamic super.x) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.one({required dynamic super.x}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.two({required dynamic super.x}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.one(X Function<X>(double) super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.two(X Function<X>(double) super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.one({required X Function<X>(double) super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.one(C5 super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.two(C5 super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.one({required C5 super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.two({required C5 super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B7({required dynamic super.x1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
-// - 'Object' is from 'dart:core'.
-// required X Function<X>(Object) super.f1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
-// required void Function<X>(X) super.g1, // Error.
-// ^
-//
-import self as self;
-import "dart:core" as core;
-
-class A1 extends core::Object {
- constructor •(core::int x) → self::A1
- : super core::Object::•()
- ;
-}
-class B1 extends self::A1 {
- constructor one(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.one(dynamic super.x); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
- constructor two(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.two(dynamic super.x) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
-}
-class A2 extends core::Object {
- constructor •({required core::String x = #C1}) → self::A2
- : super core::Object::•()
- ;
-}
-class B2 extends self::A2 {
- constructor one({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.one({required dynamic super.x}); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
- constructor two({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.two({required dynamic super.x}) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
-}
-class A3 extends core::Object {
- constructor •((core::double) → core::num f) → self::A3
- : super core::Object::•()
- ;
-}
-class B3 extends self::A3 {
- constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.one(X Function<X>(double) super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.two(X Function<X>(double) super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-class A4 extends core::Object {
- constructor •({required (core::double) → core::num f = #C1}) → self::A4
- : super core::Object::•()
- ;
-}
-class B4 extends self::A4 {
- constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.one({required X Function<X>(double) super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.two({required X Function<X>(double) super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-abstract class C5 extends core::Object {
- synthetic constructor •() → self::C5
- : super core::Object::•()
- ;
- abstract method call(core::int x, core::num y) → core::String;
-}
-class A5 extends core::Object {
- constructor •((core::int, core::num) → core::String f) → self::A5
- : super core::Object::•()
- ;
-}
-class B5 extends self::A5 {
- constructor one(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.one(C5 super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.two(C5 super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A6 extends core::Object {
- constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
- : super core::Object::•()
- ;
-}
-class B6 extends self::A6 {
- constructor one({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.one({required C5 super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.two({required C5 super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A7 extends core::Object {
- constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
- : super core::Object::•()
- ;
-}
-class B7 extends self::A7 {
- constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
- : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B7({required dynamic super.x1, // Error.
- ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
- - 'Object' is from 'dart:core'.
- required X Function<X>(Object) super.f1, // Error.
- ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
- required void Function<X>(X) super.g1, // Error.
- ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
- ;
-}
-static method main() → dynamic {}
-
-constants {
- #C1 = null
-}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline.expect
deleted file mode 100644
index 80093ec..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline.expect
+++ /dev/null
@@ -1,80 +0,0 @@
-class A1 {
- A1(int x);
-}
-
-class B1 extends A1 {
- B1.one(dynamic super.x);
- B1.two(dynamic super.x) : super();
-}
-
-class A2 {
- A2({required String x});
-}
-
-class B2 extends A2 {
- B2.one({required dynamic super.x});
- B2.two({required dynamic super.x}) : super();
-}
-
-class A3 {
- A3(num Function(double) f);
-}
-
-class B3 extends A3 {
- B3.one(X Function<X>(double) super.f);
- B3.two(X Function<X>(double) super.f) : super();
-}
-
-class A4 {
- A4({required num Function(double) f});
-}
-
-class B4 extends A4 {
- B4.one({required X Function<X>(double) super.f});
- B4.two({required X Function<X>(double) super.f}) : super();
-}
-
-abstract class C5 {
- String call(int x, num y);
-}
-
-class A5 {
- A5(String Function(int, num) f);
-}
-
-class B5 extends A5 {
- B5.one(C5 super.f);
- B5.two(C5 super.f) : super();
-}
-
-class A6 {
- A6({required String Function(int, num) f});
-}
-
-class B6 extends A6 {
- B6.one({required C5 super.f});
- B6.two({required C5 super.f}) : super();
-}
-
-class A7 {
- A7(
- {required int x1,
- required int x2,
- required bool Function(Object) f1,
- required bool Function(Object) f2,
- required void Function(dynamic) g1,
- required void Function(dynamic) g2});
-}
-
-class B7 extends A7 {
- B7(
- {required dynamic super.x1,
- required dynamic x2,
- required X Function<X>(Object) super.f1,
- required X Function<X>(Object) f2,
- required void Function<X>(X) super.g1,
- required void Function<X>(X) g2})
- : super(x2: x2, f2: f2, g2: g2);
-}
-
-main() {}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline_modelled.expect
deleted file mode 100644
index d6b43c6..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline_modelled.expect
+++ /dev/null
@@ -1,80 +0,0 @@
-abstract class C5 {
- String call(int x, num y);
-}
-
-class A1 {
- A1(int x);
-}
-
-class A2 {
- A2({required String x});
-}
-
-class A3 {
- A3(num Function(double) f);
-}
-
-class A4 {
- A4({required num Function(double) f});
-}
-
-class A5 {
- A5(String Function(int, num) f);
-}
-
-class A6 {
- A6({required String Function(int, num) f});
-}
-
-class A7 {
- A7(
- {required int x1,
- required int x2,
- required bool Function(Object) f1,
- required bool Function(Object) f2,
- required void Function(dynamic) g1,
- required void Function(dynamic) g2});
-}
-
-class B1 extends A1 {
- B1.one(dynamic super.x);
- B1.two(dynamic super.x) : super();
-}
-
-class B2 extends A2 {
- B2.one({required dynamic super.x});
- B2.two({required dynamic super.x}) : super();
-}
-
-class B3 extends A3 {
- B3.one(X Function<X>(double) super.f);
- B3.two(X Function<X>(double) super.f) : super();
-}
-
-class B4 extends A4 {
- B4.one({required X Function<X>(double) super.f});
- B4.two({required X Function<X>(double) super.f}) : super();
-}
-
-class B5 extends A5 {
- B5.one(C5 super.f);
- B5.two(C5 super.f) : super();
-}
-
-class B6 extends A6 {
- B6.one({required C5 super.f});
- B6.two({required C5 super.f}) : super();
-}
-
-class B7 extends A7 {
- B7(
- {required dynamic super.x1,
- required dynamic x2,
- required X Function<X>(Object) super.f1,
- required X Function<X>(Object) f2,
- required void Function<X>(X) super.g1,
- required void Function<X>(X) g2})
- : super(x2: x2, f2: f2, g2: g2);
-}
-
-main() {}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.expect
deleted file mode 100644
index 1d154d8..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.expect
+++ /dev/null
@@ -1,206 +0,0 @@
-library /*isNonNullableByDefault*/;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.one(dynamic super.x); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.two(dynamic super.x) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.one({required dynamic super.x}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.two({required dynamic super.x}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.one(X Function<X>(double) super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.two(X Function<X>(double) super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.one({required X Function<X>(double) super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.one(C5 super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.two(C5 super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.one({required C5 super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.two({required C5 super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B7({required dynamic super.x1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
-// - 'Object' is from 'dart:core'.
-// required X Function<X>(Object) super.f1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
-// required void Function<X>(X) super.g1, // Error.
-// ^
-//
-import self as self;
-import "dart:core" as core;
-
-class A1 extends core::Object {
- constructor •(core::int x) → self::A1
- : super core::Object::•()
- ;
-}
-class B1 extends self::A1 {
- constructor one(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.one(dynamic super.x); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
- constructor two(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.two(dynamic super.x) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
-}
-class A2 extends core::Object {
- constructor •({required core::String x = #C1}) → self::A2
- : super core::Object::•()
- ;
-}
-class B2 extends self::A2 {
- constructor one({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.one({required dynamic super.x}); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
- constructor two({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.two({required dynamic super.x}) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
-}
-class A3 extends core::Object {
- constructor •((core::double) → core::num f) → self::A3
- : super core::Object::•()
- ;
-}
-class B3 extends self::A3 {
- constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.one(X Function<X>(double) super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.two(X Function<X>(double) super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-class A4 extends core::Object {
- constructor •({required (core::double) → core::num f = #C1}) → self::A4
- : super core::Object::•()
- ;
-}
-class B4 extends self::A4 {
- constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.one({required X Function<X>(double) super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.two({required X Function<X>(double) super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-abstract class C5 extends core::Object {
- synthetic constructor •() → self::C5
- : super core::Object::•()
- ;
- abstract method call(core::int x, core::num y) → core::String;
-}
-class A5 extends core::Object {
- constructor •((core::int, core::num) → core::String f) → self::A5
- : super core::Object::•()
- ;
-}
-class B5 extends self::A5 {
- constructor one(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.one(C5 super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.two(C5 super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A6 extends core::Object {
- constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
- : super core::Object::•()
- ;
-}
-class B6 extends self::A6 {
- constructor one({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.one({required C5 super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.two({required C5 super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A7 extends core::Object {
- constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
- : super core::Object::•()
- ;
-}
-class B7 extends self::A7 {
- constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
- : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B7({required dynamic super.x1, // Error.
- ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
- - 'Object' is from 'dart:core'.
- required X Function<X>(Object) super.f1, // Error.
- ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
- required void Function<X>(X) super.g1, // Error.
- ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
- ;
-}
-static method main() → dynamic {}
-
-constants {
- #C1 = null
-}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.modular.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.modular.expect
deleted file mode 100644
index 1d154d8..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.modular.expect
+++ /dev/null
@@ -1,206 +0,0 @@
-library /*isNonNullableByDefault*/;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.one(dynamic super.x); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.two(dynamic super.x) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.one({required dynamic super.x}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.two({required dynamic super.x}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.one(X Function<X>(double) super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.two(X Function<X>(double) super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.one({required X Function<X>(double) super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.one(C5 super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.two(C5 super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.one({required C5 super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.two({required C5 super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B7({required dynamic super.x1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
-// - 'Object' is from 'dart:core'.
-// required X Function<X>(Object) super.f1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
-// required void Function<X>(X) super.g1, // Error.
-// ^
-//
-import self as self;
-import "dart:core" as core;
-
-class A1 extends core::Object {
- constructor •(core::int x) → self::A1
- : super core::Object::•()
- ;
-}
-class B1 extends self::A1 {
- constructor one(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.one(dynamic super.x); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
- constructor two(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.two(dynamic super.x) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
-}
-class A2 extends core::Object {
- constructor •({required core::String x = #C1}) → self::A2
- : super core::Object::•()
- ;
-}
-class B2 extends self::A2 {
- constructor one({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.one({required dynamic super.x}); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
- constructor two({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.two({required dynamic super.x}) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
-}
-class A3 extends core::Object {
- constructor •((core::double) → core::num f) → self::A3
- : super core::Object::•()
- ;
-}
-class B3 extends self::A3 {
- constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.one(X Function<X>(double) super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.two(X Function<X>(double) super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-class A4 extends core::Object {
- constructor •({required (core::double) → core::num f = #C1}) → self::A4
- : super core::Object::•()
- ;
-}
-class B4 extends self::A4 {
- constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.one({required X Function<X>(double) super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.two({required X Function<X>(double) super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-abstract class C5 extends core::Object {
- synthetic constructor •() → self::C5
- : super core::Object::•()
- ;
- abstract method call(core::int x, core::num y) → core::String;
-}
-class A5 extends core::Object {
- constructor •((core::int, core::num) → core::String f) → self::A5
- : super core::Object::•()
- ;
-}
-class B5 extends self::A5 {
- constructor one(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.one(C5 super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.two(C5 super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A6 extends core::Object {
- constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
- : super core::Object::•()
- ;
-}
-class B6 extends self::A6 {
- constructor one({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.one({required C5 super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.two({required C5 super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A7 extends core::Object {
- constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
- : super core::Object::•()
- ;
-}
-class B7 extends self::A7 {
- constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
- : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B7({required dynamic super.x1, // Error.
- ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
- - 'Object' is from 'dart:core'.
- required X Function<X>(Object) super.f1, // Error.
- ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
- required void Function<X>(X) super.g1, // Error.
- ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
- ;
-}
-static method main() → dynamic {}
-
-constants {
- #C1 = null
-}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.outline.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.outline.expect
deleted file mode 100644
index 7a8c89a..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.outline.expect
+++ /dev/null
@@ -1,79 +0,0 @@
-library /*isNonNullableByDefault*/;
-import self as self;
-import "dart:core" as core;
-
-class A1 extends core::Object {
- constructor •(core::int x) → self::A1
- ;
-}
-class B1 extends self::A1 {
- constructor one(dynamic x) → self::B1
- ;
- constructor two(dynamic x) → self::B1
- ;
-}
-class A2 extends core::Object {
- constructor •({required core::String x}) → self::A2
- ;
-}
-class B2 extends self::A2 {
- constructor one({required dynamic x}) → self::B2
- ;
- constructor two({required dynamic x}) → self::B2
- ;
-}
-class A3 extends core::Object {
- constructor •((core::double) → core::num f) → self::A3
- ;
-}
-class B3 extends self::A3 {
- constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- ;
- constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- ;
-}
-class A4 extends core::Object {
- constructor •({required (core::double) → core::num f}) → self::A4
- ;
-}
-class B4 extends self::A4 {
- constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f}) → self::B4
- ;
- constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f}) → self::B4
- ;
-}
-abstract class C5 extends core::Object {
- synthetic constructor •() → self::C5
- ;
- abstract method call(core::int x, core::num y) → core::String;
-}
-class A5 extends core::Object {
- constructor •((core::int, core::num) → core::String f) → self::A5
- ;
-}
-class B5 extends self::A5 {
- constructor one(self::C5 f) → self::B5
- ;
- constructor two(self::C5 f) → self::B5
- ;
-}
-class A6 extends core::Object {
- constructor •({required (core::int, core::num) → core::String f}) → self::A6
- ;
-}
-class B6 extends self::A6 {
- constructor one({required self::C5 f}) → self::B6
- ;
- constructor two({required self::C5 f}) → self::B6
- ;
-}
-class A7 extends core::Object {
- constructor •({required core::int x1, required core::int x2, required (core::Object) → core::bool f1, required (core::Object) → core::bool f2, required (dynamic) → void g1, required (dynamic) → void g2}) → self::A7
- ;
-}
-class B7 extends self::A7 {
- constructor •({required dynamic x1, required dynamic x2, required <X extends core::Object? = dynamic>(core::Object) → X% f1, required <X extends core::Object? = dynamic>(core::Object) → X% f2, required <X extends core::Object? = dynamic>(X%) → void g1, required <X extends core::Object? = dynamic>(X%) → void g2}) → self::B7
- ;
-}
-static method main() → dynamic
- ;
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.transformed.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.transformed.expect
deleted file mode 100644
index 1d154d8..0000000
--- a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.transformed.expect
+++ /dev/null
@@ -1,206 +0,0 @@
-library /*isNonNullableByDefault*/;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.one(dynamic super.x); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B1.two(dynamic super.x) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.one({required dynamic super.x}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
-// B2.two({required dynamic super.x}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.one(X Function<X>(double) super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B3.two(X Function<X>(double) super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.one({required X Function<X>(double) super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
-// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.one(C5 super.f); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B5.two(C5 super.f) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.one({required C5 super.f}); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
-// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
-// B6.two({required C5 super.f}) : super(); // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
-// B7({required dynamic super.x1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
-// - 'Object' is from 'dart:core'.
-// required X Function<X>(Object) super.f1, // Error.
-// ^
-//
-// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
-// required void Function<X>(X) super.g1, // Error.
-// ^
-//
-import self as self;
-import "dart:core" as core;
-
-class A1 extends core::Object {
- constructor •(core::int x) → self::A1
- : super core::Object::•()
- ;
-}
-class B1 extends self::A1 {
- constructor one(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.one(dynamic super.x); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
- constructor two(dynamic x) → self::B1
- : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B1.two(dynamic super.x) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::int)
- ;
-}
-class A2 extends core::Object {
- constructor •({required core::String x = #C1}) → self::A2
- : super core::Object::•()
- ;
-}
-class B2 extends self::A2 {
- constructor one({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.one({required dynamic super.x}); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
- constructor two({required dynamic x = #C1}) → self::B2
- : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
- B2.two({required dynamic super.x}) : super(); // Error.
- ^" in x as{TypeError,ForNonNullableByDefault} core::String)
- ;
-}
-class A3 extends core::Object {
- constructor •((core::double) → core::num f) → self::A3
- : super core::Object::•()
- ;
-}
-class B3 extends self::A3 {
- constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.one(X Function<X>(double) super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
- : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B3.two(X Function<X>(double) super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-class A4 extends core::Object {
- constructor •({required (core::double) → core::num f = #C1}) → self::A4
- : super core::Object::•()
- ;
-}
-class B4 extends self::A4 {
- constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.one({required X Function<X>(double) super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
- constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
- : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
- B4.two({required X Function<X>(double) super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
- ;
-}
-abstract class C5 extends core::Object {
- synthetic constructor •() → self::C5
- : super core::Object::•()
- ;
- abstract method call(core::int x, core::num y) → core::String;
-}
-class A5 extends core::Object {
- constructor •((core::int, core::num) → core::String f) → self::A5
- : super core::Object::•()
- ;
-}
-class B5 extends self::A5 {
- constructor one(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.one(C5 super.f); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two(self::C5 f) → self::B5
- : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B5.two(C5 super.f) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A6 extends core::Object {
- constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
- : super core::Object::•()
- ;
-}
-class B6 extends self::A6 {
- constructor one({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.one({required C5 super.f}); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
- constructor two({required self::C5 f = #C1}) → self::B6
- : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
- - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
- B6.two({required C5 super.f}) : super(); // Error.
- ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
- ;
-}
-class A7 extends core::Object {
- constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
- : super core::Object::•()
- ;
-}
-class B7 extends self::A7 {
- constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
- : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
- B7({required dynamic super.x1, // Error.
- ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
- - 'Object' is from 'dart:core'.
- required X Function<X>(Object) super.f1, // Error.
- ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
- required void Function<X>(X) super.g1, // Error.
- ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
- ;
-}
-static method main() → dynamic {}
-
-constants {
- #C1 = null
-}
diff --git a/pkg/js_ast/lib/js_ast.dart b/pkg/js_ast/lib/js_ast.dart
index 43cf8b9..8f75c74 100644
--- a/pkg/js_ast/lib/js_ast.dart
+++ b/pkg/js_ast/lib/js_ast.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// @dart = 2.10
+
library js_ast;
export 'src/nodes.dart';
diff --git a/pkg/js_ast/test/deferred_expression_test.dart b/pkg/js_ast/test/deferred_expression_test.dart
index ecdb774..6415b7ed 100644
--- a/pkg/js_ast/test/deferred_expression_test.dart
+++ b/pkg/js_ast/test/deferred_expression_test.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// @dart = 2.10
+
import 'package:expect/expect.dart';
import 'package:js_ast/js_ast.dart';
diff --git a/pkg/js_ast/test/deferred_statement_test.dart b/pkg/js_ast/test/deferred_statement_test.dart
index 0d309ae..9bba39a 100644
--- a/pkg/js_ast/test/deferred_statement_test.dart
+++ b/pkg/js_ast/test/deferred_statement_test.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// @dart = 2.10
+
import 'package:expect/expect.dart';
import 'package:js_ast/js_ast.dart';
diff --git a/pkg/js_ast/test/printer_callback_test.dart b/pkg/js_ast/test/printer_callback_test.dart
index f5477ba..cfd56b9 100644
--- a/pkg/js_ast/test/printer_callback_test.dart
+++ b/pkg/js_ast/test/printer_callback_test.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// @dart = 2.10
+
// Note: This test relies on LF line endings in the source file.
// Test that JS printer callbacks occur when expected.
diff --git a/pkg/js_ast/test/string_escape_test.dart b/pkg/js_ast/test/string_escape_test.dart
index 78bc758..1b0ce74 100644
--- a/pkg/js_ast/test/string_escape_test.dart
+++ b/pkg/js_ast/test/string_escape_test.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// @dart = 2.10
+
library js_ast.string_escape_test;
import 'package:js_ast/js_ast.dart';
diff --git a/pkg/modular_test/lib/src/pipeline.dart b/pkg/modular_test/lib/src/pipeline.dart
index c55f2f9..7e10bac 100644
--- a/pkg/modular_test/lib/src/pipeline.dart
+++ b/pkg/modular_test/lib/src/pipeline.dart
@@ -42,12 +42,20 @@
/// Whether this step is only executed on the main module.
final bool onlyOnMain;
+ /// Whether this step is only exceuted on the SDK.
+ final bool onlyOnSdk;
+
+ /// Whether this step is not executed on the SDK.
+ final bool notOnSdk;
+
ModularStep(
{this.needsSources: true,
this.dependencyDataNeeded: const [],
this.moduleDataNeeded: const [],
this.resultData,
- this.onlyOnMain: false});
+ this.onlyOnMain: false,
+ this.onlyOnSdk: false,
+ this.notOnSdk: false});
/// Notifies that the step was not executed, but cached instead.
void notifyCached(Module module) {}
@@ -77,6 +85,11 @@
}
void _validate() {
+ // Whether or not two steps run on mutually exclusive input data.
+ bool areMutuallyExclusive(S a, S b) {
+ return (a.onlyOnSdk && b.notOnSdk) || (b.onlyOnSdk && a.notOnSdk);
+ }
+
// Ensure that steps consume only data that was produced by previous steps
// or by the same step on a dependency.
Map<DataId, S> previousKinds = {};
@@ -86,7 +99,8 @@
"'${step.runtimeType}' needs to declare what data it produces.");
}
for (var resultKind in step.resultData) {
- if (previousKinds.containsKey(resultKind)) {
+ if (previousKinds.containsKey(resultKind) &&
+ !areMutuallyExclusive(step, previousKinds[resultKind])) {
_validationError("Cannot produce the same data on two modular steps."
" '$resultKind' was previously produced by "
"'${previousKinds[resultKind].runtimeType}' but "
@@ -140,7 +154,9 @@
deps.addAll(transitiveDependencies[dependency]);
}
- if (step.onlyOnMain && !module.isMain) return;
+ if ((step.onlyOnMain && !module.isMain) ||
+ (step.onlyOnSdk && !module.isSdk) ||
+ (step.notOnSdk && module.isSdk)) return;
// Include only requested data from transitive dependencies.
Map<Module, Set<DataId>> visibleData = {};
diff --git a/pkg/modular_test/test/io_pipeline_test.dart b/pkg/modular_test/test/io_pipeline_test.dart
index db980f8..8176201 100644
--- a/pkg/modular_test/test/io_pipeline_test.dart
+++ b/pkg/modular_test/test/io_pipeline_test.dart
@@ -107,6 +107,8 @@
List<DataId> get moduleDataNeeded => const [];
List<DataId> get resultData => [resultId];
bool get onlyOnMain => false;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
SourceOnlyStep(this.action, this.resultId, this.needsSources);
@@ -137,6 +139,8 @@
final DataId resultId;
final DataId inputId;
bool get onlyOnMain => false;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
ModuleDataStep(this.action, this.inputId, this.resultId, bool requestInput)
: moduleDataNeeded = requestInput ? [inputId] : [];
@@ -166,6 +170,8 @@
final DataId result2Id;
final DataId inputId;
bool get onlyOnMain => false;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
TwoOutputStep(
this.action1, this.action2, this.inputId, this.result1Id, this.result2Id);
@@ -198,6 +204,8 @@
final DataId depId;
final DataId resultId;
bool get onlyOnMain => false;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
LinkStep(this.action, this.inputId, this.depId, this.resultId,
bool requestDependencies)
@@ -230,6 +238,8 @@
final DataId depId;
final DataId resultId;
bool get onlyOnMain => true;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
MainOnlyStep(this.action, this.inputId, this.depId, this.resultId,
bool requestDependencies)
diff --git a/pkg/modular_test/test/memory_pipeline_test.dart b/pkg/modular_test/test/memory_pipeline_test.dart
index 1d4da36..95ba01d 100644
--- a/pkg/modular_test/test/memory_pipeline_test.dart
+++ b/pkg/modular_test/test/memory_pipeline_test.dart
@@ -86,6 +86,8 @@
List<DataId> get moduleDataNeeded => const [];
List<DataId> get resultData => [resultId];
bool get onlyOnMain => false;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
SourceOnlyStep(this.action, this.resultId, this.needsSources);
@@ -114,6 +116,8 @@
final DataId resultId;
final DataId inputId;
bool get onlyOnMain => false;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
ModuleDataStep(this.action, this.inputId, this.resultId, bool requestInput)
: moduleDataNeeded = requestInput ? [inputId] : [];
@@ -144,6 +148,8 @@
final DataId result2Id;
final DataId inputId;
bool get onlyOnMain => false;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
TwoOutputStep(
this.action1, this.action2, this.inputId, this.result1Id, this.result2Id);
@@ -177,6 +183,8 @@
final DataId resultId;
List<DataId> get resultData => [resultId];
bool get onlyOnMain => false;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
LinkStep(this.action, this.inputId, this.depId, this.resultId,
bool requestDependencies)
@@ -208,6 +216,8 @@
final DataId resultId;
List<DataId> get resultData => [resultId];
bool get onlyOnMain => true;
+ bool get onlyOnSdk => false;
+ bool get notOnSdk => false;
MainOnlyStep(this.action, this.inputId, this.depId, this.resultId,
bool requestDependencies)
diff --git a/tools/VERSION b/tools/VERSION
index 637724d..0bf68a5 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 17
PATCH 0
-PRERELEASE 258
+PRERELEASE 259
PRERELEASE_PATCH 0
\ No newline at end of file