Version 2.11.0-187.0.dev

Merge commit 'dbff41c62ccf0182a411d5cad5b4382779a2984b' into 'dev'
diff --git a/DEPS b/DEPS
index a124f6b..6c3060c 100644
--- a/DEPS
+++ b/DEPS
@@ -525,16 +525,6 @@
     "dep_type": "cipd",
   },
 
-  Var("dart_root") + "/pkg/front_end/testcases/old_dills/dills": {
-    "packages": [
-      {
-        "package": "dart/cfe/dart2js_dills",
-        "version": "binary_version:46",
-      }
-    ],
-    "dep_type": "cipd",
-  },
-
   # TODO(37531): Remove these cipd packages and build with sdk instead when
   # benchmark runner gets support for that.
   Var("dart_root") + "/benchmarks/FfiBoringssl/native/out/": {
diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
index 0dc5805..1564994 100644
--- a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
@@ -3185,6 +3185,14 @@
         r"""Null safe libraries are not allowed to export declarations from of opt-out libraries.""");
 
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeExportedMain = messageExportedMain;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageExportedMain = const MessageCode("ExportedMain",
+    severity: Severity.context,
+    message: r"""This is exported 'main' declaration.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
 const Code<Null> codeExpressionNotMetadata = messageExpressionNotMetadata;
 
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5977,6 +5985,63 @@
 }
 
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeMainNotFunctionDeclaration =
+    messageMainNotFunctionDeclaration;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageMainNotFunctionDeclaration = const MessageCode(
+    "MainNotFunctionDeclaration",
+    message: r"""The 'main' declaration must be a function declaration.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeMainNotFunctionDeclarationExported =
+    messageMainNotFunctionDeclarationExported;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageMainNotFunctionDeclarationExported = const MessageCode(
+    "MainNotFunctionDeclarationExported",
+    message:
+        r"""The exported 'main' declaration must be a function declaration.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeMainRequiredNamedParameters =
+    messageMainRequiredNamedParameters;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageMainRequiredNamedParameters = const MessageCode(
+    "MainRequiredNamedParameters",
+    message: r"""The 'main' method cannot have required named parameters.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeMainRequiredNamedParametersExported =
+    messageMainRequiredNamedParametersExported;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageMainRequiredNamedParametersExported = const MessageCode(
+    "MainRequiredNamedParametersExported",
+    message:
+        r"""The exported 'main' method cannot have required named parameters.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeMainTooManyRequiredParameters =
+    messageMainTooManyRequiredParameters;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageMainTooManyRequiredParameters = const MessageCode(
+    "MainTooManyRequiredParameters",
+    message: r"""The 'main' method must have at most 2 required parameters.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeMainTooManyRequiredParametersExported =
+    messageMainTooManyRequiredParametersExported;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageMainTooManyRequiredParametersExported = const MessageCode(
+    "MainTooManyRequiredParametersExported",
+    message:
+        r"""The exported 'main' method must have at most 2 required parameters.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
 const Code<Null> codeMapLiteralTypeArgumentMismatch =
     messageMapLiteralTypeArgumentMismatch;
 
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index b09a113..0a4dbf9 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -22,6 +22,8 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:analyzer/src/lint/linter.dart';
+import 'package:analyzer/src/lint/pub.dart';
 import 'package:analyzer/src/manifest/manifest_validator.dart';
 import 'package:analyzer/src/pubspec/pubspec_validator.dart';
 import 'package:analyzer/src/source/package_map_resolver.dart';
@@ -806,6 +808,38 @@
         var converter = AnalyzerConverter();
         convertedErrors = converter.convertAnalysisErrors(errors,
             lineInfo: lineInfo, options: driver.analysisOptions);
+
+        if (driver.analysisOptions.lint) {
+          var visitors = <LintRule, PubspecVisitor>{};
+          for (var linter in driver.analysisOptions.lintRules) {
+            if (linter is LintRule) {
+              var visitor = linter.getPubspecVisitor();
+              if (visitor != null) {
+                visitors[linter] = visitor;
+              }
+            }
+          }
+          if (visitors.isNotEmpty) {
+            var sourceUri = resourceProvider.pathContext.toUri(path);
+            var pubspecAst = Pubspec.parse(content,
+                sourceUrl: sourceUri, resourceProvider: resourceProvider);
+            var listener = RecordingErrorListener();
+            var reporter = ErrorReporter(listener,
+                resourceProvider.getFile(path).createSource(sourceUri),
+                isNonNullableByDefault: false);
+            for (var entry in visitors.entries) {
+              entry.key.reporter = reporter;
+              pubspecAst.accept(entry.value);
+            }
+            if (listener.errors.isNotEmpty) {
+              convertedErrors ??= <protocol.AnalysisError>[];
+              convertedErrors.addAll(converter.convertAnalysisErrors(
+                  listener.errors,
+                  lineInfo: lineInfo,
+                  options: driver.analysisOptions));
+            }
+          }
+        }
       }
     } catch (exception) {
       // If the file cannot be analyzed, fall through to clear any previous
diff --git a/pkg/analysis_server/test/analysis/notification_errors_test.dart b/pkg/analysis_server/test/analysis/notification_errors_test.dart
index 5a67754..aa6c33b 100644
--- a/pkg/analysis_server/test/analysis/notification_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_errors_test.dart
@@ -482,6 +482,54 @@
     expect(errors, hasLength(0));
   }
 
+  Future<void> test_pubspecFile_lint() async {
+    var optionsPath = join(projectPath, 'analysis_options.yaml');
+    newFile(optionsPath, content: '''
+linter:
+  rules:
+    - sort_pub_dependencies
+''');
+
+    var filePath = join(projectPath, 'pubspec.yaml');
+    var pubspecFile = newFile(filePath, content: '''
+name: sample
+    
+dependencies:
+  b: any
+  a: any
+''').path;
+
+    var setRootsRequest =
+        AnalysisSetAnalysisRootsParams([projectPath], []).toRequest('0');
+    handleSuccessfulRequest(setRootsRequest);
+    await waitForTasksFinished();
+    await pumpEventQueue();
+    //
+    // Verify the error result.
+    //
+    var errors = filesErrors[pubspecFile];
+    expect(errors, hasLength(1));
+    var error = errors[0];
+    expect(error.location.file, filePath);
+    expect(error.severity, AnalysisErrorSeverity.INFO);
+    expect(error.type, AnalysisErrorType.LINT);
+    //
+    // Fix the error and verify the new results.
+    //
+    modifyFile(pubspecFile, '''
+name: sample
+    
+dependencies:
+  a: any
+  b: any
+''');
+    await waitForTasksFinished();
+    await pumpEventQueue();
+
+    errors = filesErrors[pubspecFile];
+    expect(errors, hasLength(0));
+  }
+
   Future<void> test_StaticWarning() async {
     createProject();
     addTestFile('''
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart
index d397540..1ca73821 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart
@@ -478,6 +478,35 @@
 ''');
   }
 
+  @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/43667')
+  Future<void> test_method_withTypedef() async {
+    // This fails because the element representing `Base.closure` has a return
+    // type that has forgotten that it was declared using the typedef `Closure`.
+    await resolveTestUnit('''
+typedef Closure = T Function<T>(T input);
+
+abstract class Base {
+  Closure closure();
+}
+
+class Concrete extends Base {}
+''');
+    await assertHasFix('''
+typedef Closure = T Function<T>(T input);
+
+abstract class Base {
+  Closure closure();
+}
+
+class Concrete extends Base {
+  @override
+  Closure closure() {
+    // TODO: implement closure
+  }
+}
+''');
+  }
+
   Future<void> test_methods_reverseOrder() async {
     await resolveTestUnit('''
 abstract class A {
diff --git a/pkg/analyzer/lib/src/lint/linter.dart b/pkg/analyzer/lib/src/lint/linter.dart
index 2c8a521..abd18b1 100644
--- a/pkg/analyzer/lib/src/lint/linter.dart
+++ b/pkg/analyzer/lib/src/lint/linter.dart
@@ -637,8 +637,7 @@
   }
 
   void reportPubLint(PSNode node) {
-    Source source = createSource(node.span.sourceUrl);
-
+    var source = node.source;
     // Cache error and location info for creating AnalysisErrorInfos
     AnalysisError error = AnalysisError(
         source, node.span.start.offset, node.span.length, lintCode);
diff --git a/pkg/analyzer/lib/src/lint/pub.dart b/pkg/analyzer/lib/src/lint/pub.dart
index 73efafe..9d5f459 100644
--- a/pkg/analyzer/lib/src/lint/pub.dart
+++ b/pkg/analyzer/lib/src/lint/pub.dart
@@ -4,33 +4,38 @@
 
 import 'dart:collection';
 
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
+import 'package:analyzer/src/generated/source.dart';
 import 'package:source_span/source_span.dart';
 import 'package:yaml/yaml.dart';
 
-PSEntry _findEntry(YamlMap map, String key) {
+PSEntry _findEntry(YamlMap map, String key, ResourceProvider resourceProvider) {
   PSEntry entry;
   map.nodes.forEach((k, v) {
     if (k is YamlScalar && key == k.toString()) {
-      entry = _processScalar(k, v);
+      entry = _processScalar(k, v, resourceProvider);
     }
   });
   return entry;
 }
 
-PSDependencyList _processDependencies(YamlScalar key, YamlNode v) {
+PSDependencyList _processDependencies(
+    YamlScalar key, YamlNode v, ResourceProvider resourceProvider) {
   if (v is! YamlMap) {
     return null;
   }
   YamlMap depsMap = v;
 
-  _PSDependencyList deps = _PSDependencyList(_PSNode(key));
+  _PSDependencyList deps = _PSDependencyList(_PSNode(key, resourceProvider));
   depsMap.nodes.forEach((k, v) {
-    if (k is YamlScalar) deps.add(_PSDependency(k, v));
+    if (k is YamlScalar) deps.add(_PSDependency(k, v, resourceProvider));
   });
   return deps;
 }
 
-PSGitRepo _processGitRepo(YamlScalar key, YamlNode v) {
+PSGitRepo _processGitRepo(
+    YamlScalar key, YamlNode v, ResourceProvider resourceProvider) {
   if (v is! YamlMap) {
     return null;
   }
@@ -38,13 +43,14 @@
   // url: git://github.com/munificent/kittens.git
   // ref: some-branch
   _PSGitRepo repo = _PSGitRepo();
-  repo.token = _PSNode(key);
-  repo.ref = _findEntry(hostMap, 'ref');
-  repo.url = _findEntry(hostMap, 'url');
+  repo.token = _PSNode(key, resourceProvider);
+  repo.ref = _findEntry(hostMap, 'ref', resourceProvider);
+  repo.url = _findEntry(hostMap, 'url', resourceProvider);
   return repo;
 }
 
-PSHost _processHost(YamlScalar key, YamlNode v) {
+PSHost _processHost(
+    YamlScalar key, YamlNode v, ResourceProvider resourceProvider) {
   if (v is! YamlMap) {
     return null;
   }
@@ -52,27 +58,31 @@
   // name: transmogrify
   // url: http://your-package-server.com
   _PSHost host = _PSHost();
-  host.token = _PSNode(key);
-  host.name = _findEntry(hostMap, 'name');
-  host.url = _findEntry(hostMap, 'url');
+  host.token = _PSNode(key, resourceProvider);
+  host.name = _findEntry(hostMap, 'name', resourceProvider);
+  host.url = _findEntry(hostMap, 'url', resourceProvider);
   return host;
 }
 
-PSNodeList _processList(YamlScalar key, YamlNode v) {
+PSNodeList _processList(
+    YamlScalar key, YamlNode v, ResourceProvider resourceProvider) {
   if (v is! YamlList) {
     return null;
   }
   YamlList nodeList = v;
 
-  return _PSNodeList(_PSNode(key), nodeList.nodes.map((n) => _PSNode(n)));
+  return _PSNodeList(_PSNode(key, resourceProvider),
+      nodeList.nodes.map((n) => _PSNode(n, resourceProvider)));
 }
 
-PSEntry _processScalar(YamlScalar key, YamlNode value) {
+PSEntry _processScalar(
+    YamlScalar key, YamlNode value, ResourceProvider resourceProvider) {
   if (value is! YamlScalar) {
     return null;
     //WARN?
   }
-  return PSEntry(_PSNode(key), _PSNode(value));
+  return PSEntry(
+      _PSNode(key, resourceProvider), _PSNode(value, resourceProvider));
 }
 
 abstract class PSDependency {
@@ -107,6 +117,7 @@
 }
 
 abstract class PSNode {
+  Source get source;
   SourceSpan get span;
   String get text;
 }
@@ -118,8 +129,10 @@
 }
 
 abstract class Pubspec {
-  factory Pubspec.parse(String source, {Uri sourceUrl}) =>
-      _Pubspec(source, sourceUrl: sourceUrl);
+  factory Pubspec.parse(String source,
+          {Uri sourceUrl, ResourceProvider resourceProvider}) =>
+      _Pubspec(source,
+          sourceUrl: sourceUrl, resourceProvider: resourceProvider);
   PSEntry get author;
   PSNodeList get authors;
   PSDependencyList get dependencies;
@@ -161,14 +174,15 @@
   @override
   PSGitRepo git;
 
-  factory _PSDependency(YamlScalar key, YamlNode value) {
+  factory _PSDependency(
+      YamlScalar key, YamlNode value, ResourceProvider resourceProvider) {
     _PSDependency dep = _PSDependency._();
 
-    dep.name = _PSNode(key);
+    dep.name = _PSNode(key, resourceProvider);
 
     if (value is YamlScalar) {
       // Simple version
-      dep.version = PSEntry(null, _PSNode(value));
+      dep.version = PSEntry(null, _PSNode(value, resourceProvider));
     } else if (value is YamlMap) {
       // hosted:
       //   name: transmogrify
@@ -182,16 +196,16 @@
         YamlScalar key = k;
         switch (key.toString()) {
           case 'path':
-            dep.path = _processScalar(key, v);
+            dep.path = _processScalar(key, v, resourceProvider);
             break;
           case 'version':
-            dep.version = _processScalar(key, v);
+            dep.version = _processScalar(key, v, resourceProvider);
             break;
           case 'hosted':
-            dep.host = _processHost(key, v);
+            dep.host = _processHost(key, v, resourceProvider);
             break;
           case 'git':
-            dep.git = _processGitRepo(key, v);
+            dep.git = _processGitRepo(key, v, resourceProvider);
             break;
         }
       });
@@ -279,11 +293,18 @@
   @override
   final SourceSpan span;
 
-  _PSNode(YamlNode node)
+  final ResourceProvider resourceProvider;
+
+  _PSNode(YamlNode node, this.resourceProvider)
       : text = node.value?.toString(),
         span = node.span;
 
   @override
+  Source get source => (resourceProvider ?? PhysicalResourceProvider.INSTANCE)
+      .getFile(span.sourceUrl.toFilePath())
+      .createSource(span.sourceUrl);
+
+  @override
   String toString() => '$text';
 }
 
@@ -325,9 +346,9 @@
   @override
   PSDependencyList dependencyOverrides;
 
-  _Pubspec(String src, {Uri sourceUrl}) {
+  _Pubspec(String src, {Uri sourceUrl, ResourceProvider resourceProvider}) {
     try {
-      _parse(src, sourceUrl: sourceUrl);
+      _parse(src, sourceUrl: sourceUrl, resourceProvider: resourceProvider);
     } on Exception {
       // ignore
     }
@@ -385,7 +406,7 @@
     return sb.toString();
   }
 
-  void _parse(String src, {Uri sourceUrl}) {
+  void _parse(String src, {Uri sourceUrl, ResourceProvider resourceProvider}) {
     var yaml = loadYamlNode(src, sourceUrl: sourceUrl);
     if (yaml is! YamlMap) {
       return;
@@ -398,34 +419,34 @@
       YamlScalar key = k;
       switch (key.toString()) {
         case 'author':
-          author = _processScalar(key, v);
+          author = _processScalar(key, v, resourceProvider);
           break;
         case 'authors':
-          authors = _processList(key, v);
+          authors = _processList(key, v, resourceProvider);
           break;
         case 'homepage':
-          homepage = _processScalar(key, v);
+          homepage = _processScalar(key, v, resourceProvider);
           break;
         case 'name':
-          name = _processScalar(key, v);
+          name = _processScalar(key, v, resourceProvider);
           break;
         case 'description':
-          description = _processScalar(key, v);
+          description = _processScalar(key, v, resourceProvider);
           break;
         case 'documentation':
-          documentation = _processScalar(key, v);
+          documentation = _processScalar(key, v, resourceProvider);
           break;
         case 'dependencies':
-          dependencies = _processDependencies(key, v);
+          dependencies = _processDependencies(key, v, resourceProvider);
           break;
         case 'dev_dependencies':
-          devDependencies = _processDependencies(key, v);
+          devDependencies = _processDependencies(key, v, resourceProvider);
           break;
         case 'dependency_overrides':
-          dependencyOverrides = _processDependencies(key, v);
+          dependencyOverrides = _processDependencies(key, v, resourceProvider);
           break;
         case 'version':
-          version = _processScalar(key, v);
+          version = _processScalar(key, v, resourceProvider);
           break;
       }
     });
diff --git a/pkg/analyzer/lib/src/task/options.dart b/pkg/analyzer/lib/src/task/options.dart
index bbef02e..0aaf16d 100644
--- a/pkg/analyzer/lib/src/task/options.dart
+++ b/pkg/analyzer/lib/src/task/options.dart
@@ -48,7 +48,7 @@
         ];
         errors.add(AnalysisError(
             initialSource,
-            initialIncludeSpan.start.column + 1,
+            initialIncludeSpan.start.offset,
             initialIncludeSpan.length,
             AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING,
             args));
@@ -68,7 +68,7 @@
     if (includedSource == null || !includedSource.exists()) {
       errors.add(AnalysisError(
           initialSource,
-          initialIncludeSpan.start.column + 1,
+          initialIncludeSpan.start.offset,
           initialIncludeSpan.length,
           AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND,
           [includeUri, source.fullName]));
@@ -89,7 +89,7 @@
       // on the include directive located in the initial options file.
       errors.add(AnalysisError(
           initialSource,
-          initialIncludeSpan.start.column + 1,
+          initialIncludeSpan.start.offset,
           initialIncludeSpan.length,
           AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR,
           args));
@@ -101,7 +101,7 @@
     validate(source, options);
   } on OptionsFormatException catch (e) {
     SourceSpan span = e.span;
-    errors.add(AnalysisError(source, span.start.column + 1, span.length,
+    errors.add(AnalysisError(source, span.start.offset, span.length,
         AnalysisOptionsErrorCode.PARSE_ERROR, [e.message]));
   }
   return errors;
diff --git a/pkg/analyzer/test/src/diagnostics/analysis_options/analysis_options_test_support.dart b/pkg/analyzer/test/src/diagnostics/analysis_options/analysis_options_test_support.dart
new file mode 100644
index 0000000..c510595
--- /dev/null
+++ b/pkg/analyzer/test/src/diagnostics/analysis_options/analysis_options_test_support.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/base/errors.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/task/options.dart';
+
+import '../../../generated/test_support.dart';
+
+class AbstractAnalysisOptionsTest {
+  Future<void> assertErrorsInCode(
+      String code, List<ExpectedError> expectedErrors) async {
+    var diagnostics =
+        analyzeAnalysisOptions(TestSource(), code, SourceFactory([]));
+    var errorListener = GatheringErrorListener();
+    errorListener.addAll(diagnostics);
+    errorListener.assertErrors(expectedErrors);
+  }
+
+  ExpectedError error(ErrorCode code, int offset, int length,
+          {String text,
+          Pattern messageContains,
+          List<ExpectedContextMessage> contextMessages =
+              const <ExpectedContextMessage>[]}) =>
+      ExpectedError(code, offset, length,
+          message: text,
+          messageContains: messageContains,
+          expectedContextMessages: contextMessages);
+}
diff --git a/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_not_found.dart b/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_not_found.dart
new file mode 100644
index 0000000..976fc62
--- /dev/null
+++ b/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_not_found.dart
@@ -0,0 +1,24 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/analysis_options/error/option_codes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'analysis_options_test_support.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(IncludeFileNotFoundTest);
+  });
+}
+
+@reflectiveTest
+class IncludeFileNotFoundTest extends AbstractAnalysisOptionsTest {
+  void test_notFound() {
+    assertErrorsInCode('''
+# We don't depend on pedantic, but we should consider adding it.
+include: package:pedantic/analysis_options.yaml
+''', [error(AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND, 74, 38)]);
+  }
+}
diff --git a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
index 7be84f7..480cc47 100644
--- a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
+++ b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
@@ -2120,6 +2120,80 @@
 
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
 const Template<
+        Message Function(
+            DartType _type, DartType _type2, bool isNonNullableByDefault)>
+    templateMainWrongParameterType = const Template<
+            Message Function(
+                DartType _type, DartType _type2, bool isNonNullableByDefault)>(
+        messageTemplate:
+            r"""The type '#type' of the first parameter of the 'main' method is not a supertype of '#type2'.""",
+        withArguments: _withArgumentsMainWrongParameterType);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<
+        Message Function(
+            DartType _type, DartType _type2, bool isNonNullableByDefault)>
+    codeMainWrongParameterType = const Code<
+        Message Function(
+            DartType _type, DartType _type2, bool isNonNullableByDefault)>(
+  "MainWrongParameterType",
+  templateMainWrongParameterType,
+);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsMainWrongParameterType(
+    DartType _type, DartType _type2, bool isNonNullableByDefault) {
+  TypeLabeler labeler = new TypeLabeler(isNonNullableByDefault);
+  List<Object> typeParts = labeler.labelType(_type);
+  List<Object> type2Parts = labeler.labelType(_type2);
+  String type = typeParts.join();
+  String type2 = type2Parts.join();
+  return new Message(codeMainWrongParameterType,
+      message:
+          """The type '${type}' of the first parameter of the 'main' method is not a supertype of '${type2}'.""" +
+              labeler.originMessages,
+      arguments: {'type': _type, 'type2': _type2});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+        Message Function(
+            DartType _type, DartType _type2, bool isNonNullableByDefault)>
+    templateMainWrongParameterTypeExported = const Template<
+            Message Function(
+                DartType _type, DartType _type2, bool isNonNullableByDefault)>(
+        messageTemplate:
+            r"""The type '#type' of the first parameter of the exported 'main' method is not a supertype of '#type2'.""",
+        withArguments: _withArgumentsMainWrongParameterTypeExported);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<
+        Message Function(
+            DartType _type, DartType _type2, bool isNonNullableByDefault)>
+    codeMainWrongParameterTypeExported = const Code<
+        Message Function(
+            DartType _type, DartType _type2, bool isNonNullableByDefault)>(
+  "MainWrongParameterTypeExported",
+  templateMainWrongParameterTypeExported,
+);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsMainWrongParameterTypeExported(
+    DartType _type, DartType _type2, bool isNonNullableByDefault) {
+  TypeLabeler labeler = new TypeLabeler(isNonNullableByDefault);
+  List<Object> typeParts = labeler.labelType(_type);
+  List<Object> type2Parts = labeler.labelType(_type2);
+  String type = typeParts.join();
+  String type2 = type2Parts.join();
+  return new Message(codeMainWrongParameterTypeExported,
+      message:
+          """The type '${type}' of the first parameter of the exported 'main' method is not a supertype of '${type2}'.""" +
+              labeler.originMessages,
+      arguments: {'type': _type, 'type2': _type2});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
         Message Function(DartType _type, DartType _type2, DartType _type3,
             bool isNonNullableByDefault)>
     templateMixinApplicationIncompatibleSupertype = const Template<
diff --git a/pkg/front_end/lib/src/fasta/incremental_compiler.dart b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
index c1dd176..2cfabbe 100644
--- a/pkg/front_end/lib/src/fasta/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
@@ -13,6 +13,7 @@
         CanonicalNameError,
         CanonicalNameSdkError,
         CompilationModeError,
+        InvalidKernelSdkVersionError,
         InvalidKernelVersionError,
         SubComponentView;
 
@@ -1014,6 +1015,7 @@
             bytesLength = prepareSummary(summaryBytes, uriTranslator, c, data);
 
             if (e is InvalidKernelVersionError ||
+                e is InvalidKernelSdkVersionError ||
                 e is PackageChangedError ||
                 e is CanonicalNameSdkError ||
                 e is CompilationModeError) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
index d9d852a..d799e39 100644
--- a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
@@ -1043,7 +1043,23 @@
         }
       }
     } else {
+      bool sentinelInserted = false;
+      if (nodeCache.containsKey(node)) {
+        if (nodeCache[node] == null) {
+          // recursive call
+          return createErrorConstant(node, messageConstEvalCircularity);
+        }
+        // else we've seen the node before and come to a result -> we won't
+        // go into an infinite loop here either.
+      } else {
+        // We haven't seen this node before. Risk of loop.
+        nodeCache[node] = null;
+        sentinelInserted = true;
+      }
       result = node.accept(this);
+      if (sentinelInserted) {
+        nodeCache.remove(node);
+      }
       if (result is AbortConstant) {
         return result;
       }
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 ea4e30f..19f16db 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -360,6 +360,7 @@
       loader.buildOutlineExpressions(loader.coreTypes);
       loader.checkTypes();
       loader.checkRedirectingFactories(myClasses);
+      loader.checkMainMethods();
       _updateDelayedParameterTypes();
       installAllComponentProblems(loader.allComponentProblems);
       loader.allComponentProblems.clear();
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 b47a385..23761f4 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -41,6 +41,7 @@
         Library,
         LibraryDependency,
         Nullability,
+        Procedure,
         ProcedureKind,
         Reference,
         Supertype,
@@ -54,6 +55,8 @@
 
 import 'package:kernel/reference_from_index.dart' show ReferenceFromIndex;
 
+import 'package:kernel/type_environment.dart';
+
 import 'package:package_config/package_config.dart';
 
 import '../../api_prototype/file_system.dart';
@@ -71,6 +74,7 @@
 import '../builder/enum_builder.dart';
 import '../builder/extension_builder.dart';
 import '../builder/field_builder.dart';
+import '../builder/invalid_type_declaration_builder.dart';
 import '../builder/library_builder.dart';
 import '../builder/member_builder.dart';
 import '../builder/named_type_builder.dart';
@@ -81,31 +85,7 @@
 
 import '../export.dart' show Export;
 
-import '../fasta_codes.dart'
-    show
-        Message,
-        SummaryTemplate,
-        Template,
-        messageObjectExtends,
-        messageObjectImplements,
-        messageObjectMixesIn,
-        messagePartOrphan,
-        messageStrongModeNNBDButOptOut,
-        messageTypedefCause,
-        messageTypedefUnaliasedTypeCause,
-        noLength,
-        templateAmbiguousSupertypes,
-        templateCantReadFile,
-        templateCyclicClassHierarchy,
-        templateExtendingEnum,
-        templateExtendingRestricted,
-        templateIllegalMixin,
-        templateIllegalMixinDueToConstructors,
-        templateIllegalMixinDueToConstructorsCause,
-        templateInternalProblemUriMissingScheme,
-        templateSourceOutlineSummary,
-        templateStrongModeNNBDPackageOptOut,
-        templateUntranslatableUri;
+import '../fasta_codes.dart';
 
 import '../kernel/kernel_builder.dart'
     show ClassHierarchyBuilder, ClassMember, DelayedOverrideCheck;
@@ -154,8 +134,9 @@
   ReferenceFromIndex referenceFromIndex;
 
   /// Used when building directly to kernel.
-  ClassHierarchy hierarchy;
+  ClassHierarchy _hierarchy;
   CoreTypes _coreTypes;
+  TypeEnvironment _typeEnvironment;
 
   /// For builders created with a reference, this maps from that reference to
   /// that builder. This is used for looking up source builders when finalizing
@@ -199,6 +180,19 @@
     return _coreTypes;
   }
 
+  ClassHierarchy get hierarchy => _hierarchy;
+
+  void set hierarchy(ClassHierarchy value) {
+    if (_hierarchy != value) {
+      _hierarchy = value;
+      _typeEnvironment = null;
+    }
+  }
+
+  TypeEnvironment get typeEnvironment {
+    return _typeEnvironment ??= new TypeEnvironment(coreTypes, hierarchy);
+  }
+
   Template<SummaryTemplate> get outlineSummaryTemplate =>
       templateSourceOutlineSummary;
 
@@ -1232,6 +1226,134 @@
         isTopLevel: isTopLevel);
   }
 
+  void checkMainMethods() {
+    DartType listOfString;
+
+    builders.forEach((Uri uri, LibraryBuilder libraryBuilder) {
+      if (libraryBuilder.loader == this &&
+          libraryBuilder.isNonNullableByDefault) {
+        Builder mainBuilder =
+            libraryBuilder.exportScope.lookupLocalMember('main', setter: false);
+        mainBuilder ??=
+            libraryBuilder.exportScope.lookupLocalMember('main', setter: true);
+        if (mainBuilder is MemberBuilder) {
+          if (mainBuilder is InvalidTypeDeclarationBuilder) {
+            // This is an ambiguous export, skip the check.
+            return;
+          }
+          if (mainBuilder.isField ||
+              mainBuilder.isGetter ||
+              mainBuilder.isSetter) {
+            if (mainBuilder.parent != libraryBuilder) {
+              libraryBuilder.addProblem(
+                  messageMainNotFunctionDeclarationExported,
+                  libraryBuilder.charOffset,
+                  noLength,
+                  libraryBuilder.fileUri,
+                  context: [
+                    messageExportedMain.withLocation(mainBuilder.fileUri,
+                        mainBuilder.charOffset, mainBuilder.name.length)
+                  ]);
+            } else {
+              libraryBuilder.addProblem(
+                  messageMainNotFunctionDeclaration,
+                  mainBuilder.charOffset,
+                  mainBuilder.name.length,
+                  mainBuilder.fileUri);
+            }
+          } else {
+            Procedure procedure = mainBuilder.member;
+            if (procedure.function.requiredParameterCount > 2) {
+              if (mainBuilder.parent != libraryBuilder) {
+                libraryBuilder.addProblem(
+                    messageMainTooManyRequiredParametersExported,
+                    libraryBuilder.charOffset,
+                    noLength,
+                    libraryBuilder.fileUri,
+                    context: [
+                      messageExportedMain.withLocation(mainBuilder.fileUri,
+                          mainBuilder.charOffset, mainBuilder.name.length)
+                    ]);
+              } else {
+                libraryBuilder.addProblem(
+                    messageMainTooManyRequiredParameters,
+                    mainBuilder.charOffset,
+                    mainBuilder.name.length,
+                    mainBuilder.fileUri);
+              }
+            } else if (procedure.function.namedParameters
+                .any((parameter) => parameter.isRequired)) {
+              if (mainBuilder.parent != libraryBuilder) {
+                libraryBuilder.addProblem(
+                    messageMainRequiredNamedParametersExported,
+                    libraryBuilder.charOffset,
+                    noLength,
+                    libraryBuilder.fileUri,
+                    context: [
+                      messageExportedMain.withLocation(mainBuilder.fileUri,
+                          mainBuilder.charOffset, mainBuilder.name.length)
+                    ]);
+              } else {
+                libraryBuilder.addProblem(
+                    messageMainRequiredNamedParameters,
+                    mainBuilder.charOffset,
+                    mainBuilder.name.length,
+                    mainBuilder.fileUri);
+              }
+            } else if (procedure.function.positionalParameters.length > 0) {
+              DartType parameterType =
+                  procedure.function.positionalParameters.first.type;
+
+              listOfString ??= new InterfaceType(
+                  coreTypes.listClass,
+                  Nullability.nonNullable,
+                  [coreTypes.stringNonNullableRawType]);
+
+              if (!typeEnvironment.isSubtypeOf(listOfString, parameterType,
+                  SubtypeCheckMode.withNullabilities)) {
+                if (mainBuilder.parent != libraryBuilder) {
+                  libraryBuilder.addProblem(
+                      templateMainWrongParameterTypeExported.withArguments(
+                          parameterType,
+                          listOfString,
+                          libraryBuilder.isNonNullableByDefault),
+                      libraryBuilder.charOffset,
+                      noLength,
+                      libraryBuilder.fileUri,
+                      context: [
+                        messageExportedMain.withLocation(mainBuilder.fileUri,
+                            mainBuilder.charOffset, mainBuilder.name.length)
+                      ]);
+                } else {
+                  libraryBuilder.addProblem(
+                      templateMainWrongParameterType.withArguments(
+                          parameterType,
+                          listOfString,
+                          libraryBuilder.isNonNullableByDefault),
+                      mainBuilder.charOffset,
+                      mainBuilder.name.length,
+                      mainBuilder.fileUri);
+                }
+              }
+            }
+          }
+        } else if (mainBuilder != null) {
+          if (mainBuilder.parent != libraryBuilder) {
+            libraryBuilder.addProblem(messageMainNotFunctionDeclarationExported,
+                libraryBuilder.charOffset, noLength, libraryBuilder.fileUri,
+                context: [
+                  messageExportedMain.withLocation(
+                      mainBuilder.fileUri, mainBuilder.charOffset, noLength)
+                ]);
+          } else {
+            libraryBuilder.addProblem(messageMainNotFunctionDeclaration,
+                mainBuilder.charOffset, noLength, mainBuilder.fileUri);
+          }
+        }
+      }
+    });
+  }
+
   void releaseAncillaryResources() {
     hierarchy = null;
     builderHierarchy = null;
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index b2b3147..c083e2c 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -466,6 +466,18 @@
 LibraryDirectiveNotFirst/script3: Fail
 ListLiteralTooManyTypeArguments/example: Fail
 LoadLibraryTakesNoArguments/example: Fail
+MainNotFunctionDeclaration/analyzerCode: Fail
+MainNotFunctionDeclarationExported/analyzerCode: Fail
+MainNotFunctionDeclarationExported/part_wrapped_script: Fail
+MainRequiredNamedParameters/analyzerCode: Fail
+MainRequiredNamedParametersExported/analyzerCode: Fail
+MainRequiredNamedParametersExported/part_wrapped_script: Fail
+MainTooManyRequiredParameters/analyzerCode: Fail
+MainTooManyRequiredParametersExported/analyzerCode: Fail
+MainTooManyRequiredParametersExported/part_wrapped_script: Fail
+MainWrongParameterType/analyzerCode: Fail
+MainWrongParameterTypeExported/analyzerCode: Fail
+MainWrongParameterTypeExported/part_wrapped_script: Fail
 MapLiteralTypeArgumentMismatch/example: Fail
 MetadataTypeArguments/example: Fail
 MethodNotFound/example: Fail
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index 4e76c8b..d182347 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -4348,3 +4348,71 @@
 NeverValueWarning:
   template: "The expression can not result in a value with sound null safety because the expression type is `Never`."
   severity: WARNING
+
+MainNotFunctionDeclaration:
+  template: "The 'main' declaration must be a function declaration."
+  configuration: nnbd-strong
+  script:
+    - var main;
+
+MainNotFunctionDeclarationExported:
+  template: "The exported 'main' declaration must be a function declaration."
+  configuration: nnbd-strong
+  exampleAllowMoreCodes: true
+  script:
+    main.dart:
+      export 'lib.dart';
+    lib.dart:
+      var main;
+
+MainTooManyRequiredParameters:
+  template: "The 'main' method must have at most 2 required parameters."
+  configuration: nnbd-strong
+  script:
+    - main(a, b, c) {}
+
+MainTooManyRequiredParametersExported:
+  template: "The exported 'main' method must have at most 2 required parameters."
+  configuration: nnbd-strong
+  exampleAllowMoreCodes: true
+  script:
+    main.dart:
+      export 'lib.dart';
+    lib.dart:
+      main(a, b, c) {}
+
+MainRequiredNamedParameters:
+  template: "The 'main' method cannot have required named parameters."
+  configuration: nnbd-strong
+  script:
+    - main({required a}) {}
+
+MainRequiredNamedParametersExported:
+  template: "The exported 'main' method cannot have required named parameters."
+  configuration: nnbd-strong
+  exampleAllowMoreCodes: true
+  script:
+    main.dart:
+      export 'lib.dart';
+    lib.dart:
+      main({required a}) {}
+
+MainWrongParameterType:
+  template: "The type '#type' of the first parameter of the 'main' method is not a supertype of '#type2'."
+  configuration: nnbd-strong
+  script:
+    - main(Set<String> args) {}
+
+MainWrongParameterTypeExported:
+  template: "The type '#type' of the first parameter of the exported 'main' method is not a supertype of '#type2'."
+  configuration: nnbd-strong
+  exampleAllowMoreCodes: true
+  script:
+    main.dart:
+      export 'lib.dart';
+    lib.dart:
+      main(Set<String> args) {}
+
+ExportedMain:
+  template: "This is exported 'main' declaration."
+  severity: CONTEXT
diff --git a/pkg/front_end/test/old_dill_suite.dart b/pkg/front_end/test/old_dill_suite.dart
deleted file mode 100644
index c48c30b..0000000
--- a/pkg/front_end/test/old_dill_suite.dart
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async' show Future;
-
-import 'dart:io';
-
-import 'package:kernel/binary/tag.dart' show Tag;
-
-import 'package:front_end/src/base/command_line_options.dart';
-
-import 'package:testing/testing.dart'
-    show ChainContext, Result, Step, TestDescription, Chain, runMe;
-
-Future<Null> main([List<String> arguments = const []]) async {
-  if (arguments.length == 1 && arguments[0] == "--generate") {
-    print("Should now generate a dill of dart2js.");
-    await generateDill();
-    return null;
-  } else if (arguments.length == 1 && arguments[0] == "--checkDill") {
-    await checkDill();
-    return null;
-  }
-  await runMe(arguments, createContext, configurationPath: "../testing.json");
-  await checkDill();
-}
-
-String get dartVm => Platform.resolvedExecutable;
-
-Uri generateOutputUri(int binaryVersion, int compileNumber) {
-  return Uri.base.resolve("pkg/front_end/testcases/old_dills/dills/"
-      "dart2js"
-      ".version.$binaryVersion"
-      ".compile.$compileNumber"
-      ".dill");
-}
-
-verifyNotUsingCheckedInDart() {
-  String vm = dartVm.replaceAll(r"\", "/");
-  if (vm.contains("tools/sdks/dart-sdk/bin/dart")) {
-    throw "Running with checked-in VM which is not supported";
-  }
-}
-
-Future<Null> checkDill() async {
-  Uri uri = generateOutputUri(Tag.BinaryFormatVersion, 1);
-  if (!new File.fromUri(uri).existsSync()) {
-    print("File $uri doesn't exist. Generate running script");
-    print("${Platform.script.toFilePath()} --generate");
-    exit(1);
-  }
-}
-
-Future<Null> generateDill() async {
-  Uri fastaCompile = Uri.base.resolve("pkg/front_end/tool/_fasta/compile.dart");
-  if (!new File.fromUri(fastaCompile).existsSync()) {
-    throw "compile.dart from fasta tools couldn't be found";
-  }
-
-  Uri dart2js = Uri.base.resolve("pkg/compiler/bin/dart2js.dart");
-  if (!new File.fromUri(dart2js).existsSync()) {
-    throw "dart2js couldn't be found";
-  }
-
-  int compileNumber = 0;
-  Uri output;
-  do {
-    compileNumber++;
-    output = generateOutputUri(Tag.BinaryFormatVersion, compileNumber);
-  } while (new File.fromUri(output).existsSync());
-
-  ProcessResult result = await Process.run(
-      dartVm,
-      [
-        fastaCompile.toFilePath(),
-        "sdkroot:/pkg/compiler/bin/dart2js.dart",
-        "${Flags.output}",
-        output.toFilePath(),
-        "${Flags.target}=vm",
-        "${Flags.singleRootBase}=${Uri.base.toFilePath()}",
-        "${Flags.singleRootScheme}=sdkroot",
-      ],
-      workingDirectory: Uri.base.toFilePath());
-  if (result.exitCode != 0) {
-    print("stdout: ${result.stdout}");
-    print("stderr: ${result.stderr}");
-    print("Exit code: ${result.exitCode}");
-    throw "Got exit code ${result.exitCode}";
-  } else {
-    print("File generated.");
-    print("");
-    print("You should now upload via CIPD:");
-    print("");
-    print("cipd create -name dart/cfe/dart2js_dills "
-        "-in pkg/front_end/testcases/old_dills/dills/ "
-        "-install-mode copy "
-        "-tag \"binary_version:${Tag.BinaryFormatVersion}\"");
-    print("");
-    print("And update the DEPS file to say "
-        "binary_version:${Tag.BinaryFormatVersion} "
-        "under /pkg/front_end/testcases/old_dills/dills");
-  }
-}
-
-Future<Context> createContext(
-    Chain suite, Map<String, String> environment) async {
-  return new Context();
-}
-
-class Context extends ChainContext {
-  final List<Step> steps = const <Step>[
-    const RunDill(),
-  ];
-}
-
-class RunDill extends Step<TestDescription, TestDescription, Context> {
-  const RunDill();
-
-  String get name => "RunDill";
-
-  Future<Result<TestDescription>> run(
-      TestDescription description, Context context) async {
-    verifyNotUsingCheckedInDart();
-    ProcessResult result = await Process.run(
-        dartVm,
-        [
-          "--compile_all",
-          description.uri.toFilePath(),
-          "-h",
-        ],
-        workingDirectory: Uri.base.toFilePath());
-    print("stdout: ${result.stdout}");
-    print("stderr: ${result.stderr}");
-    print("Exit code: ${result.exitCode}");
-    if (result.exitCode != 0) {
-      return fail(description, "Got exit code ${result.exitCode}");
-    }
-    return pass(description);
-  }
-}
diff --git a/pkg/front_end/test/unit_test_suites.dart b/pkg/front_end/test/unit_test_suites.dart
index c106ebf..a0d190f 100644
--- a/pkg/front_end/test/unit_test_suites.dart
+++ b/pkg/front_end/test/unit_test_suites.dart
@@ -30,7 +30,6 @@
 import 'incremental_load_from_dill_suite.dart' as incremental_load
     show createContext;
 import 'lint_suite.dart' as lint show createContext;
-import 'old_dill_suite.dart' as old_dill show createContext;
 import 'parser_suite.dart' as parser show createContext;
 import 'parser_all_suite.dart' as parserAll show createContext;
 import 'spelling_test_not_src_suite.dart' as spelling_not_src
@@ -278,7 +277,6 @@
   const Suite("incremental_load_from_dill", incremental_load.createContext,
       "../testing.json"),
   const Suite("lint", lint.createContext, "../testing.json"),
-  const Suite("old_dill", old_dill.createContext, "../testing.json"),
   const Suite("parser", parser.createContext, "../testing.json"),
   const Suite("parser_all", parserAll.createContext, "../testing.json"),
   const Suite("spelling_test_not_src", spelling_not_src.createContext,
diff --git a/pkg/front_end/testcases/general/constants/circularity_test.dart b/pkg/front_end/testcases/general/constants/circularity_test.dart
new file mode 100644
index 0000000..e1e3024
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/circularity_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+const int a = b;
+const int b = a;
+const int c = d;
+const int d = e + 1;
+const int e = d - 1;
+
+class Class1 {
+  const Class1({Class1 c = const Class1(c: null)});
+}
+const Class1 c1_0 = const Class1();
+const Class1 c1_1 = const Class1(c: null);
+const Class1 c1_2 = const Class1();
+
+class Class2 {
+  final Class2 field;
+  const Class2(int value) : field = value == 0 ? null : const Class2(0);
+}
+const Class2 c2_0 = const Class2(1);
+const Class2 c2_1 = const Class2(0);
+const Class2 c2_2 = const Class2(1);
+
+class Class3 {
+  const Class3([Class3 c = c3_1]);
+}
+const Class3 c3_0 = const Class3();
+const Class3 c3_1 = const Class3(c3_2);
+const Class3 c3_2 = const Class3(null);
+
+main() {}
\ No newline at end of file
diff --git a/pkg/front_end/testcases/general/constants/circularity_test.dart.outline.expect b/pkg/front_end/testcases/general/constants/circularity_test.dart.outline.expect
new file mode 100644
index 0000000..0c18665
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/circularity_test.dart.outline.expect
@@ -0,0 +1,80 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Class1 extends core::Object /*hasConstConstructor*/  {
+  const constructor •({self::Class1* c = const self::Class1::•(c: null)}) → self::Class1*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class Class2 extends core::Object /*hasConstConstructor*/  {
+  final field self::Class2* field;
+  const constructor •(core::int* value) → self::Class2*
+    : self::Class2::field = value.{core::num::==}(0) ?{self::Class2*} null : const self::Class2::•(0), super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class Class3 extends core::Object /*hasConstConstructor*/  {
+  const constructor •([self::Class3* c = self::c3_1]) → self::Class3*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static const field core::int* a = self::b;
+static const field core::int* b = self::a;
+static const field core::int* c = self::d;
+static const field core::int* d = self::e.{core::num::+}(1);
+static const field core::int* e = self::d.{core::num::-}(1);
+static const field self::Class1* c1_0 = const self::Class1::•();
+static const field self::Class1* c1_1 = const self::Class1::•(c: null);
+static const field self::Class1* c1_2 = const self::Class1::•();
+static const field self::Class2* c2_0 = const self::Class2::•(1);
+static const field self::Class2* c2_1 = const self::Class2::•(0);
+static const field self::Class2* c2_2 = const self::Class2::•(1);
+static const field self::Class3* c3_0 = const self::Class3::•();
+static const field self::Class3* c3_1 = const self::Class3::•(self::c3_2);
+static const field self::Class3* c3_2 = const self::Class3::•(null);
+static method main() → dynamic
+  ;
+
+
+Extra constant evaluation status:
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:12:34 -> InstanceConstant(const Class1{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:20:63 -> InstanceConstant(const Class2{Class2.field: null})
+Evaluated: StaticGet @ org-dartlang-testcase:///circularity_test.dart:27:28 -> InstanceConstant(const Class3{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:14:27 -> InstanceConstant(const Class1{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:15:27 -> InstanceConstant(const Class1{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:16:27 -> InstanceConstant(const Class1{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:23:27 -> InstanceConstant(const Class2{Class2.field: null})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:29:27 -> InstanceConstant(const Class3{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:30:27 -> InstanceConstant(const Class3{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///circularity_test.dart:31:27 -> InstanceConstant(const Class3{})
+Extra constant evaluation: evaluated: 22, effectively constant: 10
diff --git a/pkg/front_end/testcases/general/constants/circularity_test.dart.strong.expect b/pkg/front_end/testcases/general/constants/circularity_test.dart.strong.expect
new file mode 100644
index 0000000..7e4fe49
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/circularity_test.dart.strong.expect
@@ -0,0 +1,106 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/circularity_test.dart:5:15: Error: Constant evaluation error:
+// const int a = b;
+//               ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:5:15: Context: Constant expression depends on itself.
+// const int a = b;
+//               ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:5:11: Context: While analyzing:
+// const int a = b;
+//           ^
+//
+// pkg/front_end/testcases/general/constants/circularity_test.dart:7:15: Error: Constant evaluation error:
+// const int c = d;
+//               ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:8:17: Context: Constant expression depends on itself.
+// const int d = e + 1;
+//                 ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:7:11: Context: While analyzing:
+// const int c = d;
+//           ^
+//
+// pkg/front_end/testcases/general/constants/circularity_test.dart:8:17: Error: Constant evaluation error:
+// const int d = e + 1;
+//                 ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:8:17: Context: Constant expression depends on itself.
+// const int d = e + 1;
+//                 ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:8:11: Context: While analyzing:
+// const int d = e + 1;
+//           ^
+//
+import self as self;
+import "dart:core" as core;
+
+class Class1 extends core::Object /*hasConstConstructor*/  {
+  const constructor •({self::Class1* c = #C1}) → self::Class1*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class Class2 extends core::Object /*hasConstConstructor*/  {
+  final field self::Class2* field;
+  const constructor •(core::int* value) → self::Class2*
+    : self::Class2::field = value.{core::num::==}(0) ?{self::Class2*} null : #C3, super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class Class3 extends core::Object /*hasConstConstructor*/  {
+  const constructor •([self::Class3* c = #C4]) → self::Class3*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static const field core::int* a = invalid-expression "Constant expression depends on itself.";
+static const field core::int* b = invalid-expression "Constant expression depends on itself.";
+static const field core::int* c = invalid-expression "Constant expression depends on itself.";
+static const field core::int* d = invalid-expression "Constant expression depends on itself.";
+static const field core::int* e = invalid-expression "Constant expression depends on itself.";
+static const field self::Class1* c1_0 = #C1;
+static const field self::Class1* c1_1 = #C1;
+static const field self::Class1* c1_2 = #C1;
+static const field self::Class2* c2_0 = #C5;
+static const field self::Class2* c2_1 = #C3;
+static const field self::Class2* c2_2 = #C5;
+static const field self::Class3* c3_0 = #C4;
+static const field self::Class3* c3_1 = #C4;
+static const field self::Class3* c3_2 = #C4;
+static method main() → dynamic {}
+
+constants  {
+  #C1 = self::Class1 {}
+  #C2 = null
+  #C3 = self::Class2 {field:#C2}
+  #C4 = self::Class3 {}
+  #C5 = self::Class2 {field:#C3}
+}
diff --git a/pkg/front_end/testcases/general/constants/circularity_test.dart.strong.transformed.expect b/pkg/front_end/testcases/general/constants/circularity_test.dart.strong.transformed.expect
new file mode 100644
index 0000000..7e4fe49
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/circularity_test.dart.strong.transformed.expect
@@ -0,0 +1,106 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/circularity_test.dart:5:15: Error: Constant evaluation error:
+// const int a = b;
+//               ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:5:15: Context: Constant expression depends on itself.
+// const int a = b;
+//               ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:5:11: Context: While analyzing:
+// const int a = b;
+//           ^
+//
+// pkg/front_end/testcases/general/constants/circularity_test.dart:7:15: Error: Constant evaluation error:
+// const int c = d;
+//               ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:8:17: Context: Constant expression depends on itself.
+// const int d = e + 1;
+//                 ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:7:11: Context: While analyzing:
+// const int c = d;
+//           ^
+//
+// pkg/front_end/testcases/general/constants/circularity_test.dart:8:17: Error: Constant evaluation error:
+// const int d = e + 1;
+//                 ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:8:17: Context: Constant expression depends on itself.
+// const int d = e + 1;
+//                 ^
+// pkg/front_end/testcases/general/constants/circularity_test.dart:8:11: Context: While analyzing:
+// const int d = e + 1;
+//           ^
+//
+import self as self;
+import "dart:core" as core;
+
+class Class1 extends core::Object /*hasConstConstructor*/  {
+  const constructor •({self::Class1* c = #C1}) → self::Class1*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class Class2 extends core::Object /*hasConstConstructor*/  {
+  final field self::Class2* field;
+  const constructor •(core::int* value) → self::Class2*
+    : self::Class2::field = value.{core::num::==}(0) ?{self::Class2*} null : #C3, super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class Class3 extends core::Object /*hasConstConstructor*/  {
+  const constructor •([self::Class3* c = #C4]) → self::Class3*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static const field core::int* a = invalid-expression "Constant expression depends on itself.";
+static const field core::int* b = invalid-expression "Constant expression depends on itself.";
+static const field core::int* c = invalid-expression "Constant expression depends on itself.";
+static const field core::int* d = invalid-expression "Constant expression depends on itself.";
+static const field core::int* e = invalid-expression "Constant expression depends on itself.";
+static const field self::Class1* c1_0 = #C1;
+static const field self::Class1* c1_1 = #C1;
+static const field self::Class1* c1_2 = #C1;
+static const field self::Class2* c2_0 = #C5;
+static const field self::Class2* c2_1 = #C3;
+static const field self::Class2* c2_2 = #C5;
+static const field self::Class3* c3_0 = #C4;
+static const field self::Class3* c3_1 = #C4;
+static const field self::Class3* c3_2 = #C4;
+static method main() → dynamic {}
+
+constants  {
+  #C1 = self::Class1 {}
+  #C2 = null
+  #C3 = self::Class2 {field:#C2}
+  #C4 = self::Class3 {}
+  #C5 = self::Class2 {field:#C3}
+}
diff --git a/pkg/front_end/testcases/general/constants/circularity_test.dart.textual_outline.expect b/pkg/front_end/testcases/general/constants/circularity_test.dart.textual_outline.expect
new file mode 100644
index 0000000..c9c576f
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/circularity_test.dart.textual_outline.expect
@@ -0,0 +1,31 @@
+const int a = b;
+const int b = a;
+const int c = d;
+const int d = e + 1;
+const int e = d - 1;
+
+class Class1 {
+  const Class1({Class1 c = const Class1(c: null)});
+}
+
+const Class1 c1_0 = const Class1();
+const Class1 c1_1 = const Class1(c: null);
+const Class1 c1_2 = const Class1();
+
+class Class2 {
+  final Class2 field;
+  const Class2(int value) : field = value == 0 ? null : const Class2(0);
+}
+
+const Class2 c2_0 = const Class2(1);
+const Class2 c2_1 = const Class2(0);
+const Class2 c2_2 = const Class2(1);
+
+class Class3 {
+  const Class3([Class3 c = c3_1]);
+}
+
+const Class3 c3_0 = const Class3();
+const Class3 c3_1 = const Class3(c3_2);
+const Class3 c3_2 = const Class3(null);
+main() {}
diff --git a/pkg/front_end/testcases/general/constants/circularity_test.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/constants/circularity_test.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..e9c0ae7
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/circularity_test.dart.textual_outline_modelled.expect
@@ -0,0 +1,28 @@
+class Class1 {
+  const Class1({Class1 c = const Class1(c: null)});
+}
+
+class Class2 {
+  const Class2(int value) : field = value == 0 ? null : const Class2(0);
+  final Class2 field;
+}
+
+class Class3 {
+  const Class3([Class3 c = c3_1]);
+}
+
+const Class1 c1_0 = const Class1();
+const Class1 c1_1 = const Class1(c: null);
+const Class1 c1_2 = const Class1();
+const Class2 c2_0 = const Class2(1);
+const Class2 c2_1 = const Class2(0);
+const Class2 c2_2 = const Class2(1);
+const Class3 c3_0 = const Class3();
+const Class3 c3_1 = const Class3(c3_2);
+const Class3 c3_2 = const Class3(null);
+const int a = b;
+const int b = a;
+const int c = d;
+const int d = e + 1;
+const int e = d - 1;
+main() {}
diff --git a/pkg/front_end/testcases/general/constants/issue_43431.dart b/pkg/front_end/testcases/general/constants/issue_43431.dart
new file mode 100644
index 0000000..c333e70
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/issue_43431.dart
@@ -0,0 +1,10 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class Foo {
+  const Foo({bool x: true});
+  const x = Foo();
+}
+
+main() {}
\ No newline at end of file
diff --git a/pkg/front_end/testcases/general/constants/issue_43431.dart.outline.expect b/pkg/front_end/testcases/general/constants/issue_43431.dart.outline.expect
new file mode 100644
index 0000000..1854d2a
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/issue_43431.dart.outline.expect
@@ -0,0 +1,30 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:3: Error: Only static fields can be declared as const.
+// Try using 'final' instead of 'const', or adding the keyword 'static'.
+//   const x = Foo();
+//   ^^^^^
+//
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object /*hasConstConstructor*/  {
+  field self::Foo* x;
+  const constructor •({core::bool* x = true}) → self::Foo*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/general/constants/issue_43431.dart.strong.expect b/pkg/front_end/testcases/general/constants/issue_43431.dart.strong.expect
new file mode 100644
index 0000000..1c887af
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/issue_43431.dart.strong.expect
@@ -0,0 +1,52 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:3: Error: Only static fields can be declared as const.
+// Try using 'final' instead of 'const', or adding the keyword 'static'.
+//   const x = Foo();
+//   ^^^^^
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:13: Error: Constant expression expected.
+// Try inserting 'const'.
+//   const x = Foo();
+//             ^^^
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:6:9: Error: Constructor is marked 'const' so all fields must be final.
+//   const Foo({bool x: true});
+//         ^
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:9: Context: Field isn't final, but constructor is 'const'.
+//   const x = Foo();
+//         ^
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:13: Error: Constant evaluation error:
+//   const x = Foo();
+//             ^
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:13: Context: Constant expression depends on itself.
+//   const x = Foo();
+//             ^
+//
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object /*hasConstConstructor*/  {
+  field self::Foo* x = invalid-expression "Constant expression depends on itself.";
+  const constructor •({core::bool* x = #C1}) → self::Foo*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic {}
+
+constants  {
+  #C1 = true
+}
diff --git a/pkg/front_end/testcases/general/constants/issue_43431.dart.strong.transformed.expect b/pkg/front_end/testcases/general/constants/issue_43431.dart.strong.transformed.expect
new file mode 100644
index 0000000..1c887af
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/issue_43431.dart.strong.transformed.expect
@@ -0,0 +1,52 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:3: Error: Only static fields can be declared as const.
+// Try using 'final' instead of 'const', or adding the keyword 'static'.
+//   const x = Foo();
+//   ^^^^^
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:13: Error: Constant expression expected.
+// Try inserting 'const'.
+//   const x = Foo();
+//             ^^^
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:6:9: Error: Constructor is marked 'const' so all fields must be final.
+//   const Foo({bool x: true});
+//         ^
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:9: Context: Field isn't final, but constructor is 'const'.
+//   const x = Foo();
+//         ^
+//
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:13: Error: Constant evaluation error:
+//   const x = Foo();
+//             ^
+// pkg/front_end/testcases/general/constants/issue_43431.dart:7:13: Context: Constant expression depends on itself.
+//   const x = Foo();
+//             ^
+//
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object /*hasConstConstructor*/  {
+  field self::Foo* x = invalid-expression "Constant expression depends on itself.";
+  const constructor •({core::bool* x = #C1}) → self::Foo*
+    : super core::Object::•()
+    ;
+  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+  abstract member-signature method toString() → core::String*; -> core::Object::toString
+  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic {}
+
+constants  {
+  #C1 = true
+}
diff --git a/pkg/front_end/testcases/general/constants/issue_43431.dart.textual_outline.expect b/pkg/front_end/testcases/general/constants/issue_43431.dart.textual_outline.expect
new file mode 100644
index 0000000..3051321
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/issue_43431.dart.textual_outline.expect
@@ -0,0 +1,6 @@
+class Foo {
+  const Foo({bool x: true});
+  const x = Foo();
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/general/constants/issue_43431.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/constants/issue_43431.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..3051321
--- /dev/null
+++ b/pkg/front_end/testcases/general/constants/issue_43431.dart.textual_outline_modelled.expect
@@ -0,0 +1,6 @@
+class Foo {
+  const Foo({bool x: true});
+  const x = Foo();
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart
new file mode 100644
index 0000000..6a834f6
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart
@@ -0,0 +1,7 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'ambiguous_main_export_lib0.dart';
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.outline.expect b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.outline.expect
new file mode 100644
index 0000000..bed220f
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.outline.expect
@@ -0,0 +1,34 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///ambiguous_main_export_lib0.dart";
+
+static method main() → dynamic
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/ambiguous_main_export_lib0.dart:6:1: Error: 'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.
+// export 'ambiguous_main_export_lib2.dart';
+// ^
+//
+import self as self2;
+
+export "org-dartlang-testcase:///ambiguous_main_export_lib1.dart";
+export "org-dartlang-testcase:///ambiguous_main_export_lib2.dart";
+
+static const field dynamic _exports# = "{\"main\":\"'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.\"}" /*isNullableByDefault, from null */;
+
+library /*isNonNullableByDefault*/;
+import self as self3;
+
+static method main() → dynamic
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as self4;
+
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.strong.expect b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.strong.expect
new file mode 100644
index 0000000..8a5ab57
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.strong.expect
@@ -0,0 +1,42 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///ambiguous_main_export_lib0.dart";
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/ambiguous_main_export_lib0.dart:6:1: Error: 'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.
+// export 'ambiguous_main_export_lib2.dart';
+// ^
+//
+import self as self2;
+import "dart:core" as core;
+
+export "org-dartlang-testcase:///ambiguous_main_export_lib1.dart";
+export "org-dartlang-testcase:///ambiguous_main_export_lib2.dart";
+
+static const field dynamic _exports# = #C1 /*isNullableByDefault, from null */;
+
+library /*isNonNullableByDefault*/;
+import self as self3;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::print(42);
+}
+
+library /*isNonNullableByDefault*/;
+import self as self4;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::print(87);
+}
+
+constants  {
+  #C1 = "{\"main\":\"'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.\"}"
+}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.strong.transformed.expect
new file mode 100644
index 0000000..8a5ab57
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.strong.transformed.expect
@@ -0,0 +1,42 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///ambiguous_main_export_lib0.dart";
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/ambiguous_main_export_lib0.dart:6:1: Error: 'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.
+// export 'ambiguous_main_export_lib2.dart';
+// ^
+//
+import self as self2;
+import "dart:core" as core;
+
+export "org-dartlang-testcase:///ambiguous_main_export_lib1.dart";
+export "org-dartlang-testcase:///ambiguous_main_export_lib2.dart";
+
+static const field dynamic _exports# = #C1 /*isNullableByDefault, from null */;
+
+library /*isNonNullableByDefault*/;
+import self as self3;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::print(42);
+}
+
+library /*isNonNullableByDefault*/;
+import self as self4;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::print(87);
+}
+
+constants  {
+  #C1 = "{\"main\":\"'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.\"}"
+}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.textual_outline.expect
new file mode 100644
index 0000000..1e66c5b
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.textual_outline.expect
@@ -0,0 +1,3 @@
+import 'ambiguous_main_export_lib0.dart';
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..1e66c5b
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.textual_outline_modelled.expect
@@ -0,0 +1,3 @@
+import 'ambiguous_main_export_lib0.dart';
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.weak.expect b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.weak.expect
new file mode 100644
index 0000000..8a5ab57
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.weak.expect
@@ -0,0 +1,42 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///ambiguous_main_export_lib0.dart";
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/ambiguous_main_export_lib0.dart:6:1: Error: 'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.
+// export 'ambiguous_main_export_lib2.dart';
+// ^
+//
+import self as self2;
+import "dart:core" as core;
+
+export "org-dartlang-testcase:///ambiguous_main_export_lib1.dart";
+export "org-dartlang-testcase:///ambiguous_main_export_lib2.dart";
+
+static const field dynamic _exports# = #C1 /*isNullableByDefault, from null */;
+
+library /*isNonNullableByDefault*/;
+import self as self3;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::print(42);
+}
+
+library /*isNonNullableByDefault*/;
+import self as self4;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::print(87);
+}
+
+constants  {
+  #C1 = "{\"main\":\"'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.\"}"
+}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.weak.transformed.expect
new file mode 100644
index 0000000..8a5ab57
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export.dart.weak.transformed.expect
@@ -0,0 +1,42 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///ambiguous_main_export_lib0.dart";
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/ambiguous_main_export_lib0.dart:6:1: Error: 'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.
+// export 'ambiguous_main_export_lib2.dart';
+// ^
+//
+import self as self2;
+import "dart:core" as core;
+
+export "org-dartlang-testcase:///ambiguous_main_export_lib1.dart";
+export "org-dartlang-testcase:///ambiguous_main_export_lib2.dart";
+
+static const field dynamic _exports# = #C1 /*isNullableByDefault, from null */;
+
+library /*isNonNullableByDefault*/;
+import self as self3;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::print(42);
+}
+
+library /*isNonNullableByDefault*/;
+import self as self4;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::print(87);
+}
+
+constants  {
+  #C1 = "{\"main\":\"'main' is exported from both 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart' and 'pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart'.\"}"
+}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib0.dart b/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib0.dart
new file mode 100644
index 0000000..f52c596
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib0.dart
@@ -0,0 +1,6 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'ambiguous_main_export_lib1.dart';
+export 'ambiguous_main_export_lib2.dart';
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart b/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart
new file mode 100644
index 0000000..50dfbde
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib1.dart
@@ -0,0 +1,7 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+main() {
+  print(42);
+}
diff --git a/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart b/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart
new file mode 100644
index 0000000..2c38c67
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/ambiguous_main_export_lib2.dart
@@ -0,0 +1,7 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+main() {
+  print(87);
+}
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration.dart b/pkg/front_end/testcases/nnbd/export_main_declaration.dart
new file mode 100644
index 0000000..20e61e6
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'export_main_declaration_class_lib.dart' as class_lib;
+import 'export_main_declaration_extension_lib.dart' as extension_lib;
+import 'export_main_declaration_field_lib.dart' as field_lib;
+import 'export_main_declaration_getter_lib.dart' as getter_lib;
+import 'export_main_declaration_method_extra_optional_parameters_lib.dart'
+    as method_extra_optional_parameters_lib;
+import 'export_main_declaration_method_named_parameters_lib.dart'
+    as method_named_parameters_lib;
+import 'export_main_declaration_method_one_optional_parameter_lib.dart'
+    as method_one_optional_parameter_lib;
+import 'export_main_declaration_method_one_parameter_lib.dart'
+    as method_one_parameter_lib;
+import 'export_main_declaration_method_one_required_optional_lib.dart'
+    as method_one_required_optional_lib;
+import 'export_main_declaration_method_required_named_parameters_lib.dart'
+    as method_required_named_parameters_lib;
+import 'export_main_declaration_method_too_many_parameters_lib.dart'
+    as method_too_many_parameters_lib;
+import 'export_main_declaration_method_two_optional_parameters_lib.dart'
+    as method_two_optional_parameters_lib;
+import 'export_main_declaration_method_two_parameters_lib.dart'
+    as method_two_parameters_lib;
+import 'export_main_declaration_method_wrong_parameter_type_lib.dart'
+    as method_wrong_parameter_type_lib;
+import 'export_main_declaration_setter_lib.dart' as setter_lib;
+import 'export_main_declaration_typedef_lib.dart' as typedef_lib;
+
+export 'main_declaration.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration.dart.outline.expect b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.outline.expect
new file mode 100644
index 0000000..4212a8e
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.outline.expect
@@ -0,0 +1,421 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_declaration.dart" as mai;
+additionalExports = (mai::main)
+
+import "org-dartlang-testcase:///export_main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///export_main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///export_main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///export_main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///export_main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///export_main_declaration_typedef_lib.dart" as typedef_lib;
+export "org-dartlang-testcase:///main_declaration.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_class_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Context: This is exported 'main' declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "main_declaration_class_lib.dart" as mai2;
+additionalExports = (mai2::main)
+
+export "org-dartlang-testcase:///main_declaration_class_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_extension_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Context: This is exported 'main' declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "main_declaration_extension_lib.dart" as mai3;
+additionalExports = (mai3::main)
+
+export "org-dartlang-testcase:///main_declaration_extension_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_field_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Context: This is exported 'main' declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "main_declaration_field_lib.dart" as mai4;
+additionalExports = (mai4::main)
+
+export "org-dartlang-testcase:///main_declaration_field_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_getter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Context: This is exported 'main' declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "main_declaration_getter_lib.dart" as mai5;
+additionalExports = (mai5::main)
+
+export "org-dartlang-testcase:///main_declaration_getter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "main_declaration_method_extra_optional_parameters_lib.dart" as mai6;
+additionalExports = (mai6::main)
+
+export "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "main_declaration_method_named_parameters_lib.dart" as mai7;
+additionalExports = (mai7::main)
+
+export "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "main_declaration_method_one_optional_parameter_lib.dart" as mai8;
+additionalExports = (mai8::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "main_declaration_method_one_parameter_lib.dart" as mai9;
+additionalExports = (mai9::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "main_declaration_method_one_required_optional_lib.dart" as mai10;
+additionalExports = (mai10::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_required_named_parameters_lib.dart: Error: The exported 'main' method cannot have required named parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "main_declaration_method_required_named_parameters_lib.dart" as mai11;
+additionalExports = (mai11::main)
+
+export "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_too_many_parameters_lib.dart: Error: The exported 'main' method must have at most 2 required parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "main_declaration_method_too_many_parameters_lib.dart" as mai12;
+additionalExports = (mai12::main)
+
+export "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "main_declaration_method_two_optional_parameters_lib.dart" as mai13;
+additionalExports = (mai13::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "main_declaration_method_two_parameters_lib.dart" as mai14;
+additionalExports = (mai14::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_wrong_parameter_type_lib.dart: Error: The type 'Set<String>' of the first parameter of the exported 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "main_declaration_method_wrong_parameter_type_lib.dart" as mai15;
+additionalExports = (mai15::main)
+
+export "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_setter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Context: This is exported 'main' declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+import "main_declaration_setter_lib.dart" as mai16;
+additionalExports = (mai16::main)
+
+export "org-dartlang-testcase:///main_declaration_setter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_typedef_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Context: This is exported 'main' declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+import "main_declaration_typedef_lib.dart" as mai17;
+additionalExports = (mai17::main)
+
+export "org-dartlang-testcase:///main_declaration_typedef_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as mai2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → mai2::main
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as mai3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as mai4;
+
+static field () → void main;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as mai5;
+
+static get main() → () → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as mai6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra]) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as mai7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args}) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as mai8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args]) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as mai9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as mai10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other]) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as mai11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args}) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as mai12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as mai13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args, dynamic other]) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as mai14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as mai15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as mai16;
+
+static set main(() → void f) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as mai17;
+
+typedef main = () → void;
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration.dart.strong.expect b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.strong.expect
new file mode 100644
index 0000000..87148a1
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.strong.expect
@@ -0,0 +1,417 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_declaration.dart" as mai;
+additionalExports = (mai::main)
+
+import "org-dartlang-testcase:///export_main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///export_main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///export_main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///export_main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///export_main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///export_main_declaration_typedef_lib.dart" as typedef_lib;
+export "org-dartlang-testcase:///main_declaration.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_class_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Context: This is exported 'main' declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "main_declaration_class_lib.dart" as mai2;
+additionalExports = (mai2::main)
+
+export "org-dartlang-testcase:///main_declaration_class_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_extension_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Context: This is exported 'main' declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "main_declaration_extension_lib.dart" as mai3;
+additionalExports = (mai3::main)
+
+export "org-dartlang-testcase:///main_declaration_extension_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_field_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Context: This is exported 'main' declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "main_declaration_field_lib.dart" as mai4;
+additionalExports = (mai4::main)
+
+export "org-dartlang-testcase:///main_declaration_field_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_getter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Context: This is exported 'main' declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "main_declaration_getter_lib.dart" as mai5;
+additionalExports = (mai5::main)
+
+export "org-dartlang-testcase:///main_declaration_getter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "main_declaration_method_extra_optional_parameters_lib.dart" as mai6;
+additionalExports = (mai6::main)
+
+export "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "main_declaration_method_named_parameters_lib.dart" as mai7;
+additionalExports = (mai7::main)
+
+export "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "main_declaration_method_one_optional_parameter_lib.dart" as mai8;
+additionalExports = (mai8::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "main_declaration_method_one_parameter_lib.dart" as mai9;
+additionalExports = (mai9::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "main_declaration_method_one_required_optional_lib.dart" as mai10;
+additionalExports = (mai10::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_required_named_parameters_lib.dart: Error: The exported 'main' method cannot have required named parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "main_declaration_method_required_named_parameters_lib.dart" as mai11;
+additionalExports = (mai11::main)
+
+export "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_too_many_parameters_lib.dart: Error: The exported 'main' method must have at most 2 required parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "main_declaration_method_too_many_parameters_lib.dart" as mai12;
+additionalExports = (mai12::main)
+
+export "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "main_declaration_method_two_optional_parameters_lib.dart" as mai13;
+additionalExports = (mai13::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "main_declaration_method_two_parameters_lib.dart" as mai14;
+additionalExports = (mai14::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_wrong_parameter_type_lib.dart: Error: The type 'Set<String>' of the first parameter of the exported 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "main_declaration_method_wrong_parameter_type_lib.dart" as mai15;
+additionalExports = (mai15::main)
+
+export "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_setter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Context: This is exported 'main' declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+import "main_declaration_setter_lib.dart" as mai16;
+additionalExports = (mai16::main)
+
+export "org-dartlang-testcase:///main_declaration_setter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_typedef_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Context: This is exported 'main' declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+import "main_declaration_typedef_lib.dart" as mai17;
+additionalExports = (mai17::main)
+
+export "org-dartlang-testcase:///main_declaration_typedef_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as mai2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → mai2::main
+    : super core::Object::•()
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as mai3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as mai4;
+import "dart:core" as core;
+
+static field () → void main = () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as mai5;
+import "dart:core" as core;
+
+static get main() → () → void
+  return () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+import self as mai6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args = #C2}) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as mai11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args = #C1}) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as mai12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args = #C2, dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as mai15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as mai16;
+
+static set main(() → void f) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as mai17;
+
+typedef main = () → void;
+
+constants  {
+  #C1 = null
+  #C2 = <core::String>[]
+}
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.strong.transformed.expect
new file mode 100644
index 0000000..87148a1
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.strong.transformed.expect
@@ -0,0 +1,417 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_declaration.dart" as mai;
+additionalExports = (mai::main)
+
+import "org-dartlang-testcase:///export_main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///export_main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///export_main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///export_main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///export_main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///export_main_declaration_typedef_lib.dart" as typedef_lib;
+export "org-dartlang-testcase:///main_declaration.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_class_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Context: This is exported 'main' declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "main_declaration_class_lib.dart" as mai2;
+additionalExports = (mai2::main)
+
+export "org-dartlang-testcase:///main_declaration_class_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_extension_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Context: This is exported 'main' declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "main_declaration_extension_lib.dart" as mai3;
+additionalExports = (mai3::main)
+
+export "org-dartlang-testcase:///main_declaration_extension_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_field_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Context: This is exported 'main' declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "main_declaration_field_lib.dart" as mai4;
+additionalExports = (mai4::main)
+
+export "org-dartlang-testcase:///main_declaration_field_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_getter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Context: This is exported 'main' declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "main_declaration_getter_lib.dart" as mai5;
+additionalExports = (mai5::main)
+
+export "org-dartlang-testcase:///main_declaration_getter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "main_declaration_method_extra_optional_parameters_lib.dart" as mai6;
+additionalExports = (mai6::main)
+
+export "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "main_declaration_method_named_parameters_lib.dart" as mai7;
+additionalExports = (mai7::main)
+
+export "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "main_declaration_method_one_optional_parameter_lib.dart" as mai8;
+additionalExports = (mai8::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "main_declaration_method_one_parameter_lib.dart" as mai9;
+additionalExports = (mai9::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "main_declaration_method_one_required_optional_lib.dart" as mai10;
+additionalExports = (mai10::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_required_named_parameters_lib.dart: Error: The exported 'main' method cannot have required named parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "main_declaration_method_required_named_parameters_lib.dart" as mai11;
+additionalExports = (mai11::main)
+
+export "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_too_many_parameters_lib.dart: Error: The exported 'main' method must have at most 2 required parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "main_declaration_method_too_many_parameters_lib.dart" as mai12;
+additionalExports = (mai12::main)
+
+export "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "main_declaration_method_two_optional_parameters_lib.dart" as mai13;
+additionalExports = (mai13::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "main_declaration_method_two_parameters_lib.dart" as mai14;
+additionalExports = (mai14::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_wrong_parameter_type_lib.dart: Error: The type 'Set<String>' of the first parameter of the exported 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "main_declaration_method_wrong_parameter_type_lib.dart" as mai15;
+additionalExports = (mai15::main)
+
+export "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_setter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Context: This is exported 'main' declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+import "main_declaration_setter_lib.dart" as mai16;
+additionalExports = (mai16::main)
+
+export "org-dartlang-testcase:///main_declaration_setter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_typedef_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Context: This is exported 'main' declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+import "main_declaration_typedef_lib.dart" as mai17;
+additionalExports = (mai17::main)
+
+export "org-dartlang-testcase:///main_declaration_typedef_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as mai2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → mai2::main
+    : super core::Object::•()
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as mai3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as mai4;
+import "dart:core" as core;
+
+static field () → void main = () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as mai5;
+import "dart:core" as core;
+
+static get main() → () → void
+  return () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+import self as mai6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args = #C2}) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as mai11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args = #C1}) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as mai12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args = #C2, dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as mai15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as mai16;
+
+static set main(() → void f) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as mai17;
+
+typedef main = () → void;
+
+constants  {
+  #C1 = null
+  #C2 = <core::String>[]
+}
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.textual_outline.expect
new file mode 100644
index 0000000..fa882bb
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.textual_outline.expect
@@ -0,0 +1,27 @@
+import 'export_main_declaration_class_lib.dart' as class_lib;
+import 'export_main_declaration_extension_lib.dart' as extension_lib;
+import 'export_main_declaration_field_lib.dart' as field_lib;
+import 'export_main_declaration_getter_lib.dart' as getter_lib;
+import 'export_main_declaration_method_extra_optional_parameters_lib.dart'
+    as method_extra_optional_parameters_lib;
+import 'export_main_declaration_method_named_parameters_lib.dart'
+    as method_named_parameters_lib;
+import 'export_main_declaration_method_one_optional_parameter_lib.dart'
+    as method_one_optional_parameter_lib;
+import 'export_main_declaration_method_one_parameter_lib.dart'
+    as method_one_parameter_lib;
+import 'export_main_declaration_method_one_required_optional_lib.dart'
+    as method_one_required_optional_lib;
+import 'export_main_declaration_method_required_named_parameters_lib.dart'
+    as method_required_named_parameters_lib;
+import 'export_main_declaration_method_too_many_parameters_lib.dart'
+    as method_too_many_parameters_lib;
+import 'export_main_declaration_method_two_optional_parameters_lib.dart'
+    as method_two_optional_parameters_lib;
+import 'export_main_declaration_method_two_parameters_lib.dart'
+    as method_two_parameters_lib;
+import 'export_main_declaration_method_wrong_parameter_type_lib.dart'
+    as method_wrong_parameter_type_lib;
+import 'export_main_declaration_setter_lib.dart' as setter_lib;
+import 'export_main_declaration_typedef_lib.dart' as typedef_lib;
+export 'main_declaration.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..a182a3e
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.textual_outline_modelled.expect
@@ -0,0 +1,27 @@
+export 'main_declaration.dart';
+import 'export_main_declaration_class_lib.dart' as class_lib;
+import 'export_main_declaration_extension_lib.dart' as extension_lib;
+import 'export_main_declaration_field_lib.dart' as field_lib;
+import 'export_main_declaration_getter_lib.dart' as getter_lib;
+import 'export_main_declaration_method_extra_optional_parameters_lib.dart'
+    as method_extra_optional_parameters_lib;
+import 'export_main_declaration_method_named_parameters_lib.dart'
+    as method_named_parameters_lib;
+import 'export_main_declaration_method_one_optional_parameter_lib.dart'
+    as method_one_optional_parameter_lib;
+import 'export_main_declaration_method_one_parameter_lib.dart'
+    as method_one_parameter_lib;
+import 'export_main_declaration_method_one_required_optional_lib.dart'
+    as method_one_required_optional_lib;
+import 'export_main_declaration_method_required_named_parameters_lib.dart'
+    as method_required_named_parameters_lib;
+import 'export_main_declaration_method_too_many_parameters_lib.dart'
+    as method_too_many_parameters_lib;
+import 'export_main_declaration_method_two_optional_parameters_lib.dart'
+    as method_two_optional_parameters_lib;
+import 'export_main_declaration_method_two_parameters_lib.dart'
+    as method_two_parameters_lib;
+import 'export_main_declaration_method_wrong_parameter_type_lib.dart'
+    as method_wrong_parameter_type_lib;
+import 'export_main_declaration_setter_lib.dart' as setter_lib;
+import 'export_main_declaration_typedef_lib.dart' as typedef_lib;
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration.dart.weak.expect b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.weak.expect
new file mode 100644
index 0000000..00c2307
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.weak.expect
@@ -0,0 +1,417 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_declaration.dart" as mai;
+additionalExports = (mai::main)
+
+import "org-dartlang-testcase:///export_main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///export_main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///export_main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///export_main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///export_main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///export_main_declaration_typedef_lib.dart" as typedef_lib;
+export "org-dartlang-testcase:///main_declaration.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_class_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Context: This is exported 'main' declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "main_declaration_class_lib.dart" as mai2;
+additionalExports = (mai2::main)
+
+export "org-dartlang-testcase:///main_declaration_class_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_extension_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Context: This is exported 'main' declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "main_declaration_extension_lib.dart" as mai3;
+additionalExports = (mai3::main)
+
+export "org-dartlang-testcase:///main_declaration_extension_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_field_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Context: This is exported 'main' declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "main_declaration_field_lib.dart" as mai4;
+additionalExports = (mai4::main)
+
+export "org-dartlang-testcase:///main_declaration_field_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_getter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Context: This is exported 'main' declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "main_declaration_getter_lib.dart" as mai5;
+additionalExports = (mai5::main)
+
+export "org-dartlang-testcase:///main_declaration_getter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "main_declaration_method_extra_optional_parameters_lib.dart" as mai6;
+additionalExports = (mai6::main)
+
+export "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "main_declaration_method_named_parameters_lib.dart" as mai7;
+additionalExports = (mai7::main)
+
+export "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "main_declaration_method_one_optional_parameter_lib.dart" as mai8;
+additionalExports = (mai8::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "main_declaration_method_one_parameter_lib.dart" as mai9;
+additionalExports = (mai9::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "main_declaration_method_one_required_optional_lib.dart" as mai10;
+additionalExports = (mai10::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_required_named_parameters_lib.dart: Error: The exported 'main' method cannot have required named parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "main_declaration_method_required_named_parameters_lib.dart" as mai11;
+additionalExports = (mai11::main)
+
+export "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_too_many_parameters_lib.dart: Error: The exported 'main' method must have at most 2 required parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "main_declaration_method_too_many_parameters_lib.dart" as mai12;
+additionalExports = (mai12::main)
+
+export "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "main_declaration_method_two_optional_parameters_lib.dart" as mai13;
+additionalExports = (mai13::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "main_declaration_method_two_parameters_lib.dart" as mai14;
+additionalExports = (mai14::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_wrong_parameter_type_lib.dart: Error: The type 'Set<String>' of the first parameter of the exported 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "main_declaration_method_wrong_parameter_type_lib.dart" as mai15;
+additionalExports = (mai15::main)
+
+export "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_setter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Context: This is exported 'main' declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+import "main_declaration_setter_lib.dart" as mai16;
+additionalExports = (mai16::main)
+
+export "org-dartlang-testcase:///main_declaration_setter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_typedef_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Context: This is exported 'main' declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+import "main_declaration_typedef_lib.dart" as mai17;
+additionalExports = (mai17::main)
+
+export "org-dartlang-testcase:///main_declaration_typedef_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as mai2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → mai2::main
+    : super core::Object::•()
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as mai3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as mai4;
+import "dart:core" as core;
+
+static field () → void main = () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as mai5;
+import "dart:core" as core;
+
+static get main() → () → void
+  return () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+import self as mai6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args = #C2}) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as mai11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args = #C1}) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as mai12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args = #C2, dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as mai15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as mai16;
+
+static set main(() → void f) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as mai17;
+
+typedef main = () → void;
+
+constants  {
+  #C1 = null
+  #C2 = <core::String*>[]
+}
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.weak.transformed.expect
new file mode 100644
index 0000000..00c2307
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration.dart.weak.transformed.expect
@@ -0,0 +1,417 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_declaration.dart" as mai;
+additionalExports = (mai::main)
+
+import "org-dartlang-testcase:///export_main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///export_main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///export_main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///export_main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///export_main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///export_main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///export_main_declaration_typedef_lib.dart" as typedef_lib;
+export "org-dartlang-testcase:///main_declaration.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_class_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Context: This is exported 'main' declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "main_declaration_class_lib.dart" as mai2;
+additionalExports = (mai2::main)
+
+export "org-dartlang-testcase:///main_declaration_class_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_extension_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Context: This is exported 'main' declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "main_declaration_extension_lib.dart" as mai3;
+additionalExports = (mai3::main)
+
+export "org-dartlang-testcase:///main_declaration_extension_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_field_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Context: This is exported 'main' declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "main_declaration_field_lib.dart" as mai4;
+additionalExports = (mai4::main)
+
+export "org-dartlang-testcase:///main_declaration_field_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_getter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Context: This is exported 'main' declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "main_declaration_getter_lib.dart" as mai5;
+additionalExports = (mai5::main)
+
+export "org-dartlang-testcase:///main_declaration_getter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "main_declaration_method_extra_optional_parameters_lib.dart" as mai6;
+additionalExports = (mai6::main)
+
+export "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "main_declaration_method_named_parameters_lib.dart" as mai7;
+additionalExports = (mai7::main)
+
+export "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "main_declaration_method_one_optional_parameter_lib.dart" as mai8;
+additionalExports = (mai8::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "main_declaration_method_one_parameter_lib.dart" as mai9;
+additionalExports = (mai9::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "main_declaration_method_one_required_optional_lib.dart" as mai10;
+additionalExports = (mai10::main)
+
+export "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_required_named_parameters_lib.dart: Error: The exported 'main' method cannot have required named parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "main_declaration_method_required_named_parameters_lib.dart" as mai11;
+additionalExports = (mai11::main)
+
+export "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_too_many_parameters_lib.dart: Error: The exported 'main' method must have at most 2 required parameters.
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "main_declaration_method_too_many_parameters_lib.dart" as mai12;
+additionalExports = (mai12::main)
+
+export "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "main_declaration_method_two_optional_parameters_lib.dart" as mai13;
+additionalExports = (mai13::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "main_declaration_method_two_parameters_lib.dart" as mai14;
+additionalExports = (mai14::main)
+
+export "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_method_wrong_parameter_type_lib.dart: Error: The type 'Set<String>' of the first parameter of the exported 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Context: This is exported 'main' declaration.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "main_declaration_method_wrong_parameter_type_lib.dart" as mai15;
+additionalExports = (mai15::main)
+
+export "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_setter_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Context: This is exported 'main' declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+import "main_declaration_setter_lib.dart" as mai16;
+additionalExports = (mai16::main)
+
+export "org-dartlang-testcase:///main_declaration_setter_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/export_main_declaration_typedef_lib.dart: Error: The exported 'main' declaration must be a function declaration.
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Context: This is exported 'main' declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+import "main_declaration_typedef_lib.dart" as mai17;
+additionalExports = (mai17::main)
+
+export "org-dartlang-testcase:///main_declaration_typedef_lib.dart";
+
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as mai2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → mai2::main
+    : super core::Object::•()
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as mai3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as mai4;
+import "dart:core" as core;
+
+static field () → void main = () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as mai5;
+import "dart:core" as core;
+
+static get main() → () → void
+  return () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+import self as mai6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args = #C2}) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as mai11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args = #C1}) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as mai12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args = #C2, dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as mai15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as mai16;
+
+static set main(() → void f) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as mai17;
+
+typedef main = () → void;
+
+constants  {
+  #C1 = null
+  #C2 = <core::String*>[]
+}
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_class_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_class_lib.dart
new file mode 100644
index 0000000..6e90759e
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_class_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_class_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_extension_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_extension_lib.dart
new file mode 100644
index 0000000..23551a6
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_extension_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_extension_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_field_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_field_lib.dart
new file mode 100644
index 0000000..748d5f6
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_field_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_field_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_getter_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_getter_lib.dart
new file mode 100644
index 0000000..f9664ca
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_getter_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_getter_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_extra_optional_parameters_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_extra_optional_parameters_lib.dart
new file mode 100644
index 0000000..9baf657
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_extra_optional_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_extra_optional_parameters_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_named_parameters_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_named_parameters_lib.dart
new file mode 100644
index 0000000..8463a27
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_named_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_named_parameters_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_optional_parameter_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_optional_parameter_lib.dart
new file mode 100644
index 0000000..b085630
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_optional_parameter_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_one_optional_parameter_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_parameter_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_parameter_lib.dart
new file mode 100644
index 0000000..0763ad4
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_parameter_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_one_parameter_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_required_optional_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_required_optional_lib.dart
new file mode 100644
index 0000000..dc1d7da
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_one_required_optional_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_one_required_optional_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_required_named_parameters_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_required_named_parameters_lib.dart
new file mode 100644
index 0000000..0496be2
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_required_named_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_required_named_parameters_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_too_many_parameters_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_too_many_parameters_lib.dart
new file mode 100644
index 0000000..3158bed
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_too_many_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_too_many_parameters_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_two_optional_parameters_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_two_optional_parameters_lib.dart
new file mode 100644
index 0000000..1fd396a
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_two_optional_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_two_optional_parameters_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_two_parameters_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_two_parameters_lib.dart
new file mode 100644
index 0000000..a59df30
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_two_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_two_parameters_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_method_wrong_parameter_type_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_method_wrong_parameter_type_lib.dart
new file mode 100644
index 0000000..ecb7126
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_method_wrong_parameter_type_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_method_wrong_parameter_type_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_setter_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_setter_lib.dart
new file mode 100644
index 0000000..2f994d9
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_setter_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_setter_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/export_main_declaration_typedef_lib.dart b/pkg/front_end/testcases/nnbd/export_main_declaration_typedef_lib.dart
new file mode 100644
index 0000000..79c9645
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/export_main_declaration_typedef_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'main_declaration_typedef_lib.dart';
diff --git a/pkg/front_end/testcases/nnbd/main_declaration.dart b/pkg/front_end/testcases/nnbd/main_declaration.dart
new file mode 100644
index 0000000..102df45
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'main_declaration_class_lib.dart' as class_lib;
+import 'main_declaration_extension_lib.dart' as extension_lib;
+import 'main_declaration_field_lib.dart' as field_lib;
+import 'main_declaration_getter_lib.dart' as getter_lib;
+import 'main_declaration_method_extra_optional_parameters_lib.dart'
+    as method_extra_optional_parameters_lib;
+import 'main_declaration_method_named_parameters_lib.dart'
+    as method_named_parameters_lib;
+import 'main_declaration_method_one_optional_parameter_lib.dart'
+    as method_one_optional_parameter_lib;
+import 'main_declaration_method_one_parameter_lib.dart'
+    as method_one_parameter_lib;
+import 'main_declaration_method_one_required_optional_lib.dart'
+    as method_one_required_optional_lib;
+import 'main_declaration_method_required_named_parameters_lib.dart'
+    as method_required_named_parameters_lib;
+import 'main_declaration_method_too_many_parameters_lib.dart'
+    as method_too_many_parameters_lib;
+import 'main_declaration_method_two_optional_parameters_lib.dart'
+    as method_two_optional_parameters_lib;
+import 'main_declaration_method_two_parameters_lib.dart'
+    as method_two_parameters_lib;
+import 'main_declaration_method_wrong_parameter_type_lib.dart'
+    as method_wrong_parameter_type_lib;
+import 'main_declaration_setter_lib.dart' as setter_lib;
+import 'main_declaration_typedef_lib.dart' as typedef_lib;
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration.dart.outline.expect b/pkg/front_end/testcases/nnbd/main_declaration.dart.outline.expect
new file mode 100644
index 0000000..60101d4
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration.dart.outline.expect
@@ -0,0 +1,195 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → self2::main
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+
+static field () → void main;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+
+static get main() → () → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra]) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args}) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args]) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other]) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args}) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args, dynamic other]) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+
+static set main(() → void f) → void
+  ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+
+typedef main = () → void;
diff --git a/pkg/front_end/testcases/nnbd/main_declaration.dart.strong.expect b/pkg/front_end/testcases/nnbd/main_declaration.dart.strong.expect
new file mode 100644
index 0000000..bef2df6
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration.dart.strong.expect
@@ -0,0 +1,191 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → self2::main
+    : super core::Object::•()
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "dart:core" as core;
+
+static field () → void main = () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "dart:core" as core;
+
+static get main() → () → void
+  return () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args = #C2}) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args = #C1}) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args = #C2, dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+
+static set main(() → void f) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+
+typedef main = () → void;
+
+constants  {
+  #C1 = null
+  #C2 = <core::String>[]
+}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/main_declaration.dart.strong.transformed.expect
new file mode 100644
index 0000000..bef2df6
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration.dart.strong.transformed.expect
@@ -0,0 +1,191 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → self2::main
+    : super core::Object::•()
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "dart:core" as core;
+
+static field () → void main = () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "dart:core" as core;
+
+static get main() → () → void
+  return () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args = #C2}) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args = #C1}) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args = #C2, dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+
+static set main(() → void f) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+
+typedef main = () → void;
+
+constants  {
+  #C1 = null
+  #C2 = <core::String>[]
+}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/main_declaration.dart.textual_outline.expect
new file mode 100644
index 0000000..13c6b88
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration.dart.textual_outline.expect
@@ -0,0 +1,28 @@
+import 'main_declaration_class_lib.dart' as class_lib;
+import 'main_declaration_extension_lib.dart' as extension_lib;
+import 'main_declaration_field_lib.dart' as field_lib;
+import 'main_declaration_getter_lib.dart' as getter_lib;
+import 'main_declaration_method_extra_optional_parameters_lib.dart'
+    as method_extra_optional_parameters_lib;
+import 'main_declaration_method_named_parameters_lib.dart'
+    as method_named_parameters_lib;
+import 'main_declaration_method_one_optional_parameter_lib.dart'
+    as method_one_optional_parameter_lib;
+import 'main_declaration_method_one_parameter_lib.dart'
+    as method_one_parameter_lib;
+import 'main_declaration_method_one_required_optional_lib.dart'
+    as method_one_required_optional_lib;
+import 'main_declaration_method_required_named_parameters_lib.dart'
+    as method_required_named_parameters_lib;
+import 'main_declaration_method_too_many_parameters_lib.dart'
+    as method_too_many_parameters_lib;
+import 'main_declaration_method_two_optional_parameters_lib.dart'
+    as method_two_optional_parameters_lib;
+import 'main_declaration_method_two_parameters_lib.dart'
+    as method_two_parameters_lib;
+import 'main_declaration_method_wrong_parameter_type_lib.dart'
+    as method_wrong_parameter_type_lib;
+import 'main_declaration_setter_lib.dart' as setter_lib;
+import 'main_declaration_typedef_lib.dart' as typedef_lib;
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/main_declaration.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..13c6b88
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration.dart.textual_outline_modelled.expect
@@ -0,0 +1,28 @@
+import 'main_declaration_class_lib.dart' as class_lib;
+import 'main_declaration_extension_lib.dart' as extension_lib;
+import 'main_declaration_field_lib.dart' as field_lib;
+import 'main_declaration_getter_lib.dart' as getter_lib;
+import 'main_declaration_method_extra_optional_parameters_lib.dart'
+    as method_extra_optional_parameters_lib;
+import 'main_declaration_method_named_parameters_lib.dart'
+    as method_named_parameters_lib;
+import 'main_declaration_method_one_optional_parameter_lib.dart'
+    as method_one_optional_parameter_lib;
+import 'main_declaration_method_one_parameter_lib.dart'
+    as method_one_parameter_lib;
+import 'main_declaration_method_one_required_optional_lib.dart'
+    as method_one_required_optional_lib;
+import 'main_declaration_method_required_named_parameters_lib.dart'
+    as method_required_named_parameters_lib;
+import 'main_declaration_method_too_many_parameters_lib.dart'
+    as method_too_many_parameters_lib;
+import 'main_declaration_method_two_optional_parameters_lib.dart'
+    as method_two_optional_parameters_lib;
+import 'main_declaration_method_two_parameters_lib.dart'
+    as method_two_parameters_lib;
+import 'main_declaration_method_wrong_parameter_type_lib.dart'
+    as method_wrong_parameter_type_lib;
+import 'main_declaration_setter_lib.dart' as setter_lib;
+import 'main_declaration_typedef_lib.dart' as typedef_lib;
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration.dart.weak.expect b/pkg/front_end/testcases/nnbd/main_declaration.dart.weak.expect
new file mode 100644
index 0000000..c850a85
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration.dart.weak.expect
@@ -0,0 +1,191 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → self2::main
+    : super core::Object::•()
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "dart:core" as core;
+
+static field () → void main = () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "dart:core" as core;
+
+static get main() → () → void
+  return () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args = #C2}) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args = #C1}) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args = #C2, dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+
+static set main(() → void f) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+
+typedef main = () → void;
+
+constants  {
+  #C1 = null
+  #C2 = <core::String*>[]
+}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/main_declaration.dart.weak.transformed.expect
new file mode 100644
index 0000000..c850a85
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration.dart.weak.transformed.expect
@@ -0,0 +1,191 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "org-dartlang-testcase:///main_declaration_class_lib.dart" as class_lib;
+import "org-dartlang-testcase:///main_declaration_extension_lib.dart" as extension_lib;
+import "org-dartlang-testcase:///main_declaration_field_lib.dart" as field_lib;
+import "org-dartlang-testcase:///main_declaration_getter_lib.dart" as getter_lib;
+import "org-dartlang-testcase:///main_declaration_method_extra_optional_parameters_lib.dart" as method_extra_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_named_parameters_lib.dart" as method_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_optional_parameter_lib.dart" as method_one_optional_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_parameter_lib.dart" as method_one_parameter_lib;
+import "org-dartlang-testcase:///main_declaration_method_one_required_optional_lib.dart" as method_one_required_optional_lib;
+import "org-dartlang-testcase:///main_declaration_method_required_named_parameters_lib.dart" as method_required_named_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_too_many_parameters_lib.dart" as method_too_many_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_optional_parameters_lib.dart" as method_two_optional_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_two_parameters_lib.dart" as method_two_parameters_lib;
+import "org-dartlang-testcase:///main_declaration_method_wrong_parameter_type_lib.dart" as method_wrong_parameter_type_lib;
+import "org-dartlang-testcase:///main_declaration_setter_lib.dart" as setter_lib;
+import "org-dartlang-testcase:///main_declaration_typedef_lib.dart" as typedef_lib;
+
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart:5:7: Error: The 'main' declaration must be a function declaration.
+// class main /* error */ {}
+//       ^
+//
+import self as self2;
+import "dart:core" as core;
+
+class main extends core::Object {
+  synthetic constructor •() → self2::main
+    : super core::Object::•()
+    ;
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart:5:11: Error: The 'main' declaration must be a function declaration.
+// extension main /* error */ on Object {}
+//           ^
+//
+import self as self3;
+import "dart:core" as core;
+
+extension main on core::Object {
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart:5:17: Error: The 'main' declaration must be a function declaration.
+// void Function() main /* error */ = () {};
+//                 ^^^^
+//
+import self as self4;
+import "dart:core" as core;
+
+static field () → void main = () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart:5:21: Error: The 'main' declaration must be a function declaration.
+// void Function() get main /* error */ => () {};
+//                     ^^^^
+//
+import self as self5;
+import "dart:core" as core;
+
+static get main() → () → void
+  return () → core::Null? {};
+
+library /*isNonNullableByDefault*/;
+import self as self6;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other, [dynamic extra = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self7;
+import "dart:core" as core;
+
+static method main({core::List<core::String> args = #C2}) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self8;
+import "dart:core" as core;
+
+static method main([core::List<core::String>? args = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self9;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self10;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, [dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart:5:6: Error: The 'main' method cannot have required named parameters.
+// void main({required List<String> args}) /* error */ {}
+//      ^^^^
+//
+import self as self11;
+import "dart:core" as core;
+
+static method main({required core::List<core::String> args = #C1}) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart:5:6: Error: The 'main' method must have at most 2 required parameters.
+// void main(List<String> args, a, b) /* error */ {}
+//      ^^^^
+//
+import self as self12;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic a, dynamic b) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self13;
+import "dart:core" as core;
+
+static method main([core::List<core::String> args = #C2, dynamic other = #C1]) → void {}
+
+library /*isNonNullableByDefault*/;
+import self as self14;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args, dynamic other) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart:5:6: Error: The type 'Set<String>' of the first parameter of the 'main' method is not a supertype of 'List<String>'.
+//  - 'Set' is from 'dart:core'.
+//  - 'List' is from 'dart:core'.
+// void main(Set<String> args) /* error */ {}
+//      ^^^^
+//
+import self as self15;
+import "dart:core" as core;
+
+static method main(core::Set<core::String> args) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart:5:10: Error: The 'main' declaration must be a function declaration.
+// void set main(void Function() f) /* error */ {}
+//          ^^^^
+//
+import self as self16;
+
+static set main(() → void f) → void {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart:5:9: Error: The 'main' declaration must be a function declaration.
+// typedef main /* error */ = void Function();
+//         ^
+//
+import self as self17;
+
+typedef main = () → void;
+
+constants  {
+  #C1 = null
+  #C2 = <core::String*>[]
+}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart
new file mode 100644
index 0000000..3adbd2d
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_class_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class main /* error */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart
new file mode 100644
index 0000000..5ac4335
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_extension_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+extension main /* error */ on Object {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart
new file mode 100644
index 0000000..a90670e
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_field_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void Function() main /* error */ = () {};
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart
new file mode 100644
index 0000000..fb93e96
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_getter_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void Function() get main /* error */ => () {};
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_extra_optional_parameters_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_extra_optional_parameters_lib.dart
new file mode 100644
index 0000000..1d64aba
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_extra_optional_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main(List<String> args, other, [extra]) /* ok */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_named_parameters_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_named_parameters_lib.dart
new file mode 100644
index 0000000..22ff181
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_named_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main({List<String> args = const []}) /* ok */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_one_optional_parameter_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_one_optional_parameter_lib.dart
new file mode 100644
index 0000000..bcdd265
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_one_optional_parameter_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main([List<String>? args]) /* ok */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_one_parameter_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_one_parameter_lib.dart
new file mode 100644
index 0000000..1c04bbf
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_one_parameter_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main(List<String> args) /* ok */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_one_required_optional_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_one_required_optional_lib.dart
new file mode 100644
index 0000000..1a18bcb
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_one_required_optional_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main(List<String> args, [other]) /* ok */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart
new file mode 100644
index 0000000..705bf05
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_required_named_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main({required List<String> args}) /* error */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart
new file mode 100644
index 0000000..9fc54c9
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_too_many_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main(List<String> args, a, b) /* error */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_two_optional_parameters_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_two_optional_parameters_lib.dart
new file mode 100644
index 0000000..5659662
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_two_optional_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main([List<String> args = const [], other]) /* ok */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_two_parameters_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_two_parameters_lib.dart
new file mode 100644
index 0000000..d737d25
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_two_parameters_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main(List<String> args, other) /* ok */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart
new file mode 100644
index 0000000..c0a8f34
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_method_wrong_parameter_type_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void main(Set<String> args) /* error */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart
new file mode 100644
index 0000000..d9fd5bc
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_setter_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void set main(void Function() f) /* error */ {}
diff --git a/pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart b/pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart
new file mode 100644
index 0000000..d0ea0fa
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/main_declaration_typedef_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+typedef main /* error */ = void Function();
diff --git a/pkg/front_end/testcases/old_dills/.gitignore b/pkg/front_end/testcases/old_dills/.gitignore
deleted file mode 100644
index e449e17..0000000
--- a/pkg/front_end/testcases/old_dills/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-dills
diff --git a/pkg/front_end/testcases/old_dills/old_dills.status b/pkg/front_end/testcases/old_dills/old_dills.status
deleted file mode 100644
index e22cfe5..0000000
--- a/pkg/front_end/testcases/old_dills/old_dills.status
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE.md file.
diff --git a/pkg/front_end/testing.json b/pkg/front_end/testing.json
index 418cb27..47f67ff 100644
--- a/pkg/front_end/testing.json
+++ b/pkg/front_end/testing.json
@@ -252,17 +252,6 @@
       "exclude": []
     },
     {
-      "name": "old_dill",
-      "kind": "Chain",
-      "source": "test/old_dill_suite.dart",
-      "path": "testcases/old_dills/dills/",
-      "status": "testcases/old_dills/old_dills.status",
-      "pattern": [
-        ".*\\.dill$"
-      ],
-      "exclude": []
-    },
-    {
       "name": "parser",
       "kind": "Chain",
       "source": "test/parser_suite.dart",
diff --git a/pkg/kernel/tool/smoke_test_quick.dart b/pkg/kernel/tool/smoke_test_quick.dart
index 53cfae1..bf32ec3 100644
--- a/pkg/kernel/tool/smoke_test_quick.dart
+++ b/pkg/kernel/tool/smoke_test_quick.dart
@@ -11,7 +11,6 @@
 main(List<String> args) async {
   Stopwatch stopwatch = new Stopwatch()..start();
   List<Future> futures = new List<Future>();
-  futures.add(run("pkg/front_end/test/old_dill_suite.dart", ["--checkDill"]));
   futures.add(run("pkg/front_end/test/spelling_test_src_suite.dart",
       ["--", "spelling_test_src/kernel/..."]));
   await Future.wait(futures);
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc
index 9710b64..e45c42d 100644
--- a/runtime/lib/object.cc
+++ b/runtime/lib/object.cc
@@ -497,9 +497,14 @@
   InvocationMirror::Kind kind;
   InvocationMirror::DecodeType(invocation_type.Value(), &level, &kind);
 
-  Function& function = Function::Handle();
+  Function& function = Function::Handle(zone);
   if (receiver.IsType()) {
-    Class& cls = Class::Handle(Type::Cast(receiver).type_class());
+    const auto& cls = Class::Handle(zone, Type::Cast(receiver).type_class());
+    const auto& error = Error::Handle(zone, cls.EnsureIsFinalized(thread));
+    if (!error.IsNull()) {
+      Exceptions::PropagateError(error);
+      UNREACHABLE();
+    }
     if (level == InvocationMirror::kConstructor) {
       function = cls.LookupConstructor(method_name);
       if (function.IsNull()) {
@@ -511,7 +516,7 @@
   } else if (receiver.IsClosure()) {
     function = Closure::Cast(receiver).function();
   } else {
-    Class& cls = Class::Handle(receiver.clazz());
+    auto& cls = Class::Handle(zone, receiver.clazz());
     if (level == InvocationMirror::kSuper) {
       cls = cls.SuperClass();
     }
diff --git a/runtime/tests/vm/dart/regress43666_test.dart b/runtime/tests/vm/dart/regress43666_test.dart
new file mode 100644
index 0000000..49bb218
--- /dev/null
+++ b/runtime/tests/vm/dart/regress43666_test.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class Foo {
+  void bar() {}
+}
+
+void main(List<String> arguments) {
+  dynamic exception = null;
+  try {
+    final typeObject = Foo as dynamic;
+    print(typeObject.bar);
+  } catch (e) {
+    exception = e;
+  }
+  Expect.isNotNull(exception);
+  Expect.isTrue(exception is NoSuchMethodError);
+  // The NoSuchMethodError.toString() in the regression caused a crash.
+  Expect.isTrue(exception.toString().contains('NoSuchMethodError'));
+}
diff --git a/runtime/tests/vm/dart_2/regress43666_test.dart b/runtime/tests/vm/dart_2/regress43666_test.dart
new file mode 100644
index 0000000..49bb218
--- /dev/null
+++ b/runtime/tests/vm/dart_2/regress43666_test.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class Foo {
+  void bar() {}
+}
+
+void main(List<String> arguments) {
+  dynamic exception = null;
+  try {
+    final typeObject = Foo as dynamic;
+    print(typeObject.bar);
+  } catch (e) {
+    exception = e;
+  }
+  Expect.isNotNull(exception);
+  Expect.isTrue(exception is NoSuchMethodError);
+  // The NoSuchMethodError.toString() in the regression caused a crash.
+  Expect.isTrue(exception.toString().contains('NoSuchMethodError'));
+}
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 2c7a938..820e53f 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -986,7 +986,6 @@
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   ASSERT(isolate != NULL);
-  ASSERT(!Isolate::IsSystemIsolate(isolate));
 
   if (FLAG_trace_service) {
     OS::PrintErr(
diff --git a/runtime/vm/tagged_pointer.h b/runtime/vm/tagged_pointer.h
index e1f6c15..0cd8548 100644
--- a/runtime/vm/tagged_pointer.h
+++ b/runtime/vm/tagged_pointer.h
@@ -224,7 +224,6 @@
         : base##Ptr(other) {}                                                  \
     klass##Ptr() : base##Ptr() {}                                              \
     explicit constexpr klass##Ptr(uword tagged) : base##Ptr(tagged) {}         \
-    explicit constexpr klass##Ptr(intptr_t tagged) : base##Ptr(tagged) {}      \
     constexpr klass##Ptr(std::nullptr_t) : base##Ptr(nullptr) {} /* NOLINT */  \
     explicit klass##Ptr(const ObjectLayout* untagged)                          \
         : base##Ptr(reinterpret_cast<uword>(untagged) + kHeapObjectTag) {}     \
diff --git a/sdk/lib/collection/set.dart b/sdk/lib/collection/set.dart
index 1eb7491..0a6ccbf 100644
--- a/sdk/lib/collection/set.dart
+++ b/sdk/lib/collection/set.dart
@@ -294,7 +294,7 @@
 /// Implementations of `Set` using this base should consider also implementing
 /// `clear` in constant time. The default implementation works by removing every
 /// element.
-abstract class SetBase<E> extends Object with SetMixin<E> {
+abstract class SetBase<E> with SetMixin<E> {
   /// Converts a [Set] to a [String].
   ///
   /// Converts [set] to a string by converting each element to a string (by
@@ -308,10 +308,7 @@
 }
 
 /// Common internal implementation of some [Set] methods.
-// TODO(35548): Make this mix-in SetMixin, by adding `with SetMixin<E>`
-// and removing the copied members below,
-// when analyzer supports const constructors for mixin applications.
-abstract class _SetBase<E> implements Set<E> {
+abstract class _SetBase<E> with SetMixin<E> {
   // The following two methods override the ones in SetBase.
   // It's possible to be more efficient if we have a way to create an empty
   // set of the correct type.
@@ -341,228 +338,6 @@
 
   // Subclasses can optimize this further.
   Set<E> toSet() => _newSet()..addAll(this);
-
-  /// TODO(35548): Remove the following declarations again when the analyzer
-  /// supports mixins with const constructors, and mix in `SetMixin` instead.
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => length != 0;
-
-  Iterable<E> followedBy(Iterable<E> other) =>
-      FollowedByIterable<E>.firstEfficient(this, other);
-
-  Iterable<T> whereType<T>() => WhereTypeIterable<T>(this);
-
-  void clear() {
-    removeAll(toList());
-  }
-
-  void addAll(Iterable<E> elements) {
-    for (E element in elements) add(element);
-  }
-
-  void removeAll(Iterable<Object?> elements) {
-    for (Object? element in elements) remove(element);
-  }
-
-  void retainAll(Iterable<Object?> elements) {
-    // Create a copy of the set, remove all of elements from the copy,
-    // then remove all remaining elements in copy from this.
-    Set<E> toRemove = toSet();
-    for (Object? o in elements) {
-      toRemove.remove(o);
-    }
-    removeAll(toRemove);
-  }
-
-  void removeWhere(bool test(E element)) {
-    List<Object?> toRemove = [];
-    for (E element in this) {
-      if (test(element)) toRemove.add(element);
-    }
-    removeAll(toRemove);
-  }
-
-  void retainWhere(bool test(E element)) {
-    List<Object?> toRemove = [];
-    for (E element in this) {
-      if (!test(element)) toRemove.add(element);
-    }
-    removeAll(toRemove);
-  }
-
-  bool containsAll(Iterable<Object?> other) {
-    for (Object? o in other) {
-      if (!contains(o)) return false;
-    }
-    return true;
-  }
-
-  Set<E> union(Set<E> other) {
-    return toSet()..addAll(other);
-  }
-
-  List<E> toList({bool growable = true}) =>
-      List<E>.of(this, growable: growable);
-
-  Iterable<T> map<T>(T f(E element)) =>
-      EfficientLengthMappedIterable<E, T>(this, f);
-
-  E get single {
-    if (length > 1) throw IterableElementError.tooMany();
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) throw IterableElementError.noElement();
-    E result = it.current;
-    return result;
-  }
-
-  String toString() => IterableBase.iterableToFullString(this, '{', '}');
-
-  Iterable<E> where(bool f(E element)) => WhereIterable<E>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(E element)) =>
-      ExpandIterable<E, T>(this, f);
-
-  void forEach(void f(E element)) {
-    for (E element in this) f(element);
-  }
-
-  E reduce(E combine(E value, E element)) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E value = iterator.current;
-    while (iterator.moveNext()) {
-      value = combine(value, iterator.current);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    var value = initialValue;
-    for (E element in this) value = combine(value, element);
-    return value;
-  }
-
-  bool every(bool f(E element)) {
-    for (E element in this) {
-      if (!f(element)) return false;
-    }
-    return true;
-  }
-
-  String join([String separator = ""]) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) return "";
-    StringBuffer buffer = StringBuffer();
-    if (separator == null || separator == "") {
-      do {
-        buffer.write(iterator.current);
-      } while (iterator.moveNext());
-    } else {
-      buffer.write(iterator.current);
-      while (iterator.moveNext()) {
-        buffer.write(separator);
-        buffer.write(iterator.current);
-      }
-    }
-    return buffer.toString();
-  }
-
-  bool any(bool test(E element)) {
-    for (E element in this) {
-      if (test(element)) return true;
-    }
-    return false;
-  }
-
-  Iterable<E> take(int n) {
-    return TakeIterable<E>(this, n);
-  }
-
-  Iterable<E> takeWhile(bool test(E value)) {
-    return TakeWhileIterable<E>(this, test);
-  }
-
-  Iterable<E> skip(int n) {
-    return SkipIterable<E>(this, n);
-  }
-
-  Iterable<E> skipWhile(bool test(E value)) {
-    return SkipWhileIterable<E>(this, test);
-  }
-
-  E get first {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    return it.current;
-  }
-
-  E get last {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E result;
-    do {
-      result = it.current;
-    } while (it.moveNext());
-    return result;
-  }
-
-  E firstWhere(bool test(E value), {E Function()? orElse}) {
-    for (E element in this) {
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool test(E value), {E Function()? orElse}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool test(E value), {E Function()? orElse}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E elementAt(int index) {
-    ArgumentError.checkNotNull(index, "index");
-    RangeError.checkNotNegative(index, "index");
-    int elementIndex = 0;
-    for (E element in this) {
-      if (index == elementIndex) return element;
-      elementIndex++;
-    }
-    throw RangeError.index(index, this, "index", null, elementIndex);
-  }
 }
 
 /// Class used to implement const sets.
diff --git a/tests/language/main/main_test.dart b/tests/language/main/main_test.dart
index da3b57e..6b5c24c 100644
--- a/tests/language/main/main_test.dart
+++ b/tests/language/main/main_test.dart
@@ -6,7 +6,7 @@
 
 a //        //# 01: ok
 a, b //     //# 02: ok
-a, b, c //  //# 03: ok
+a, b, c //  //# 03: compile-time error
 a, b, {c}   //# 04: ok
 a, b, [c]   //# 05: ok
 
diff --git a/tests/language/null_aware/null_shortening_test.dart b/tests/language/null_aware/null_shortening_test.dart
index f4ce95c..b3510a5 100644
--- a/tests/language/null_aware/null_shortening_test.dart
+++ b/tests/language/null_aware/null_shortening_test.dart
@@ -159,8 +159,8 @@
   c1q?.cq!.expectStaticType<Exactly<C1>>();
   (c1q?.cq!).expectStaticType<Exactly<C1?>>();
   (c1q?.cq)!.expectStaticType<Exactly<C1>>();
-  c1q?.cn!.c.expectStaticType<Exactly<C1>>();
-  (c1q?.cn!.c).expectStaticType<Exactly<C1?>>();
+  c1q?.cq!.c.expectStaticType<Exactly<C1>>();
+  (c1q?.cq!.c).expectStaticType<Exactly<C1?>>();
   c1q?[1].expectStaticType<Exactly<C1>>();
   (c1q?[1]).expectStaticType<Exactly<C1?>>();
 
diff --git a/tools/VERSION b/tools/VERSION
index 6113aa7..81db08d 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 11
 PATCH 0
-PRERELEASE 186
+PRERELEASE 187
 PRERELEASE_PATCH 0
\ No newline at end of file