Recover from duplicated declarations

Before, a duplciated declaration would cause the compiler to abort using
deprecated_InputError.

Change-Id: Ide8d13802045e9a349f0f408a6d174a47c7f6418
Reviewed-on: https://dart-review.googlesource.com/76122
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
diff --git a/pkg/front_end/lib/src/fasta/builder/class_builder.dart b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
index d2b9c0f..6c2bb49 100644
--- a/pkg/front_end/lib/src/fasta/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
@@ -240,6 +240,22 @@
   }
 
   void prepareTopLevelInference() {}
+
+  /// Find the first member of this class with [name]. This method isn't
+  /// suitable for scope lookups as it will throw an error if the name isn't
+  /// declared. The [scope] should be used for that. This method is used to
+  /// find a member that is known to exist and it wil pick the first
+  /// declaration if the name is ambiguous.
+  ///
+  /// For example, this method is convenient for use when building synthetic
+  /// members, such as those of an enum.
+  MemberBuilder firstMemberNamed(String name) {
+    Declaration declaration = this[name];
+    while (declaration.next != null) {
+      declaration = declaration.next;
+    }
+    return declaration;
+  }
 }
 
 class ConstructorRedirection {
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 63d3ae2..64a2e04 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -501,11 +501,17 @@
       Expression initializer = pop();
       Identifier identifier = pop();
       String name = identifier.name;
-      FieldBuilder<Object> field;
+      Declaration declaration;
       if (classBuilder != null) {
-        field = classBuilder[name];
+        declaration = classBuilder[name];
       } else {
-        field = library[name];
+        declaration = library[name];
+      }
+      FieldBuilder<Object> field;
+      if (declaration.isField && declaration.next == null) {
+        field = declaration;
+      } else {
+        continue;
       }
       fields.add(field);
       if (initializer != null) {
@@ -2305,6 +2311,13 @@
       if (result == null) {
         unhandled("null", "result", beginToken.charOffset, uri);
       }
+    } else if (name is ProblemBuilder) {
+      // TODO(ahe): Arguments could be passed here.
+      result = new KernelNamedTypeBuilder(name.name, null)
+        ..bind(new KernelInvalidTypeBuilder(
+            name.name,
+            name.message.withLocation(
+                name.fileUri, name.charOffset, name.name.length)));
     } else {
       unhandled(
           "${name.runtimeType}", "handleType", beginToken.charOffset, uri);
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
index 208c345..908aa05 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
@@ -186,16 +186,12 @@
               charOffset, name.length, parent.fileUri,
               context: context);
           enumConstantInfos[i] = null;
-          continue;
-        }
-        if (name == className) {
+        } else if (name == className) {
           parent.addProblem(
               templateEnumConstantSameNameAsEnclosing.withArguments(name),
               charOffset,
               name.length,
               parent.fileUri);
-          enumConstantInfos[i] = null;
-          continue;
         }
         KernelFieldBuilder fieldBuilder = new KernelFieldBuilder(
             metadata,
@@ -208,7 +204,7 @@
             true);
         metadataCollector?.setDocumentationComment(
             fieldBuilder.target, documentationComment);
-        members[name] = fieldBuilder;
+        members[name] = fieldBuilder..next = existing;
       }
     }
     final int startCharOffset =
@@ -229,10 +225,11 @@
         parent,
         startCharOffset,
         charOffset);
-    // TODO(sigmund): dynamic should be `covariant MemberBuilder`.
-    void setParent(String name, dynamic b) {
-      MemberBuilder builder = b;
-      builder.parent = enumBuilder;
+    void setParent(String name, MemberBuilder builder) {
+      do {
+        builder.parent = enumBuilder;
+        builder = builder.next;
+      } while (builder != null);
     }
 
     members.forEach(setParent);
@@ -259,23 +256,26 @@
         coreLibrary.scope, charOffset, fileUri, libraryBuilder);
     listType.resolveIn(coreLibrary.scope, charOffset, fileUri, libraryBuilder);
 
-    KernelFieldBuilder indexFieldBuilder = this["index"];
+    KernelFieldBuilder indexFieldBuilder = firstMemberNamed("index");
     Field indexField = indexFieldBuilder.build(libraryBuilder);
-    KernelFieldBuilder nameFieldBuilder = this["_name"];
+    KernelFieldBuilder nameFieldBuilder = firstMemberNamed("_name");
     Field nameField = nameFieldBuilder.build(libraryBuilder);
-    KernelProcedureBuilder toStringBuilder = this["toString"];
+    KernelProcedureBuilder toStringBuilder = firstMemberNamed("toString");
     toStringBuilder.body = new ReturnStatement(
         new DirectPropertyGet(new ThisExpression(), nameField));
     List<Expression> values = <Expression>[];
     if (enumConstantInfos != null) {
       for (EnumConstantInfo enumConstantInfo in enumConstantInfos) {
         if (enumConstantInfo != null) {
-          KernelFieldBuilder builder = this[enumConstantInfo.name];
-          values.add(new StaticGet(builder.build(libraryBuilder)));
+          Declaration declaration = firstMemberNamed(enumConstantInfo.name);
+          if (declaration.isField) {
+            KernelFieldBuilder field = declaration;
+            values.add(new StaticGet(field.build(libraryBuilder)));
+          }
         }
       }
     }
-    KernelFieldBuilder valuesBuilder = this["values"];
+    KernelFieldBuilder valuesBuilder = firstMemberNamed("values");
     valuesBuilder.build(libraryBuilder);
     valuesBuilder.initializer =
         new ListLiteral(values, typeArgument: cls.rawType, isConst: true);
@@ -311,8 +311,13 @@
       for (EnumConstantInfo enumConstantInfo in enumConstantInfos) {
         if (enumConstantInfo != null) {
           String constant = enumConstantInfo.name;
-          KernelFieldBuilder field = this[constant];
-          field.build(libraryBuilder);
+          Declaration declaration = firstMemberNamed(constant);
+          KernelFieldBuilder field;
+          if (declaration.isField) {
+            field = declaration;
+          } else {
+            continue;
+          }
           Arguments arguments = new Arguments(<Expression>[
             new IntLiteral(index++),
             new StringLiteral("$name.$constant")
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator.dart
index a3de284..b7ac953 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator.dart
@@ -31,6 +31,8 @@
 
 import '../problems.dart' show unhandled, unsupported;
 
+import '../scope.dart' show AmbiguousBuilder;
+
 import 'body_builder.dart' show noLocation;
 
 import 'constness.dart' show Constness;
@@ -1296,7 +1298,7 @@
     if (declaration is KernelClassBuilder) {
       KernelClassBuilder declaration = this.declaration;
       Declaration member = declaration.findStaticBuilder(
-          name.name, offsetForToken(token), uri, helper.library);
+          name.name, offsetForToken(send.token), uri, helper.library);
 
       Generator generator;
       if (member == null) {
@@ -1314,6 +1316,9 @@
               token.charOffset,
               Constness.implicit);
         }
+      } else if (member is AmbiguousBuilder) {
+        return helper.buildProblem(
+            member.message, member.charOffset, name.name.length);
       } else {
         Declaration setter;
         if (member.isSetter) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
index af4869f..cae832e 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
@@ -801,11 +801,24 @@
       return;
     }
     if (cls != null) {
+      if (declaration.next != null) {
+        int count = 0;
+        Declaration current = declaration.next;
+        while (current != null) {
+          count++;
+          current = current.next;
+        }
+        cls.name += "#$count";
+      }
       library.addClass(cls);
     } else if (member != null) {
-      library.addMember(member);
+      if (declaration.next == null) {
+        library.addMember(member);
+      }
     } else if (typedef != null) {
-      library.addTypedef(typedef);
+      if (declaration.next == null) {
+        library.addTypedef(typedef);
+      }
     }
   }
 
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 acfee6f..bf3f19e 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -69,6 +69,8 @@
 
 import '../severity.dart' show Severity;
 
+import '../scope.dart' show AmbiguousBuilder;
+
 import '../source/source_class_builder.dart' show SourceClassBuilder;
 
 import '../source/source_loader.dart' show SourceLoader;
@@ -405,6 +407,10 @@
       // TODO(sigmund): do only for full program
       Declaration declaration =
           loader.first.exportScope.lookup("main", -1, null);
+      if (declaration is AmbiguousBuilder) {
+        AmbiguousBuilder problem = declaration;
+        declaration = problem.getFirstDeclaration();
+      }
       if (declaration is KernelProcedureBuilder) {
         component.mainMethod = declaration.procedure;
       } else if (declaration is DillMemberBuilder) {
diff --git a/pkg/front_end/lib/src/fasta/scope.dart b/pkg/front_end/lib/src/fasta/scope.dart
index 42dc27d..a8d2025 100644
--- a/pkg/front_end/lib/src/fasta/scope.dart
+++ b/pkg/front_end/lib/src/fasta/scope.dart
@@ -354,4 +354,12 @@
   Message get message => templateDuplicatedDeclarationUse.withArguments(name);
 
   // TODO(ahe): Also provide context.
+
+  Declaration getFirstDeclaration() {
+    Declaration declaration = builder;
+    while (declaration.next != null) {
+      declaration = declaration.next;
+    }
+    return declaration;
+  }
 }
diff --git a/pkg/front_end/lib/src/fasta/source/diet_listener.dart b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
index bc03d28..facfdae 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -27,8 +27,7 @@
 
 import '../crash.dart' show Crash;
 
-import '../deprecated_problems.dart'
-    show deprecated_InputError, deprecated_inputError;
+import '../deprecated_problems.dart' show deprecated_InputError;
 
 import '../fasta_codes.dart'
     show
@@ -679,8 +678,21 @@
   }
 
   @override
+  void beginMixinDeclaration(Token mixinKeyword, Token name) {
+    debugEvent("beginMixinDeclaration");
+    push(mixinKeyword);
+  }
+
+  @override
+  void beginClassDeclaration(Token begin, Token abstractToken, Token name) {
+    debugEvent("beginClassDeclaration");
+    push(begin);
+  }
+
+  @override
   void beginClassOrMixinBody(Token token) {
     debugEvent("beginClassOrMixinBody");
+    Token beginToken = pop();
     Object name = pop();
     Token metadata = pop();
     assert(currentClass == null);
@@ -690,7 +702,7 @@
       return;
     }
 
-    Declaration classBuilder = lookupBuilder(token, null, name);
+    Declaration classBuilder = lookupBuilder(beginToken, null, name);
     parseMetadata(classBuilder, metadata, classBuilder.target);
 
     currentClass = classBuilder;
@@ -856,6 +868,7 @@
     } else {
       declaration = library.scopeBuilder[name];
     }
+    declaration = handleDuplicatedName(declaration, token);
     checkBuilder(token, declaration, name);
     return declaration;
   }
@@ -870,18 +883,37 @@
       suffix = nameOrQualified == currentClass.name ? "" : nameOrQualified;
     }
     declaration = currentClass.constructors.local[suffix];
+    declaration = handleDuplicatedName(declaration, token);
     checkBuilder(token, declaration, nameOrQualified);
     return declaration;
   }
 
+  Declaration handleDuplicatedName(Declaration declaration, Token token) {
+    int offset = token.charOffset;
+    if (declaration?.next == null) {
+      return declaration;
+    } else {
+      Declaration nearestDeclaration;
+      int minDistance = -1;
+      do {
+        int distance = declaration.charOffset - offset;
+        if (distance >= 0) {
+          if (minDistance == -1 || distance < minDistance) {
+            minDistance = distance;
+            nearestDeclaration = declaration;
+          }
+        }
+        declaration = declaration.next;
+      } while (declaration != null);
+      return nearestDeclaration;
+    }
+  }
+
   void checkBuilder(Token token, Declaration declaration, Object name) {
     if (declaration == null) {
       internalProblem(templateInternalProblemNotFound.withArguments("$name"),
           token.charOffset, uri);
     }
-    if (declaration.next != null) {
-      deprecated_inputError(uri, token.charOffset, "Duplicated name: $name");
-    }
     if (uri != declaration.fileUri) {
       unexpected("$uri", "${declaration.fileUri}", declaration.charOffset,
           declaration.fileUri);
diff --git a/pkg/front_end/lib/src/fasta/source/source_class_builder.dart b/pkg/front_end/lib/src/fasta/source/source_class_builder.dart
index e04fdd6..16ee2a6 100644
--- a/pkg/front_end/lib/src/fasta/source/source_class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_class_builder.dart
@@ -127,12 +127,12 @@
           // TODO(ahe): It would be nice to have a common interface for the
           // build method to avoid duplicating these two cases.
           Member field = declaration.build(library);
-          if (!declaration.isPatch) {
+          if (!declaration.isPatch && declaration.next == null) {
             cls.addMember(field);
           }
         } else if (declaration is KernelFunctionBuilder) {
           Member function = declaration.build(library);
-          if (!declaration.isPatch) {
+          if (!declaration.isPatch && declaration.next == null) {
             cls.addMember(function);
           }
         } else {
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index 10fc532..fc2c472 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -99,7 +99,6 @@
 DirectiveAfterDeclaration/script2: Fail
 DuplicateDeferred/example: Fail
 DuplicatePrefix/example: Fail
-DuplicatedDeclaration/script: Fail
 DuplicatedDeclarationUse/analyzerCode: Fail # No corresponding analyzer code.
 DuplicatedDeclarationUse/script1: Fail # This test can't pass.
 DuplicatedDeclarationUse/script2: Fail # Wrong error.
diff --git a/pkg/front_end/testcases/bug31124.dart.direct.expect b/pkg/front_end/testcases/bug31124.dart.direct.expect
index f2376e3..559f7d8 100644
--- a/pkg/front_end/testcases/bug31124.dart.direct.expect
+++ b/pkg/front_end/testcases/bug31124.dart.direct.expect
@@ -11,16 +11,19 @@
 // pkg/front_end/testcases/bug31124.dart:1:5: Error: Previous declaration of 'a'.
 // var a = () => 'b';a();
 //     ^
+
+// Unhandled errors:
 //
-// pkg/front_end/testcases/bug31124.dart:1:1: Error: Duplicated name: a
+// pkg/front_end/testcases/bug31124.dart:1:22: Error: Expected a function body or '=>'.
+// Try adding {}.
 // var a = () => 'b';a();
-// ^
+//                      ^
+//
+// pkg/front_end/testcases/bug31124.dart:1:19: Error: 'a' is already declared in this scope.
+// var a = () => 'b';a();
+//                   ^
 
 library;
 import self as self;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/bug31124.dart:1:1: Error: Duplicated name: a
-var a = () => 'b';a();
-^";
-}
+static field dynamic a;
diff --git a/pkg/front_end/testcases/bug31124.dart.direct.transformed.expect b/pkg/front_end/testcases/bug31124.dart.direct.transformed.expect
index e470ed2..b75686c 100644
--- a/pkg/front_end/testcases/bug31124.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/bug31124.dart.direct.transformed.expect
@@ -1,8 +1,15 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/bug31124.dart:1:22: Error: Expected a function body or '=>'.
+// Try adding {}.
+// var a = () => 'b';a();
+//                      ^
+//
+// pkg/front_end/testcases/bug31124.dart:1:19: Error: 'a' is already declared in this scope.
+// var a = () => 'b';a();
+//                   ^
+
 library;
 import self as self;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/bug31124.dart:1:1: Error: Duplicated name: a
-var a = () => 'b';a();
-^";
-}
+static field dynamic a;
diff --git a/pkg/front_end/testcases/bug31124.dart.outline.expect b/pkg/front_end/testcases/bug31124.dart.outline.expect
index 768d9ef..ef07e67 100644
--- a/pkg/front_end/testcases/bug31124.dart.outline.expect
+++ b/pkg/front_end/testcases/bug31124.dart.outline.expect
@@ -16,4 +16,3 @@
 import self as self;
 
 static field dynamic a;
-static abstract method a() → dynamic;
diff --git a/pkg/front_end/testcases/bug31124.dart.strong.expect b/pkg/front_end/testcases/bug31124.dart.strong.expect
index f2376e3..559f7d8 100644
--- a/pkg/front_end/testcases/bug31124.dart.strong.expect
+++ b/pkg/front_end/testcases/bug31124.dart.strong.expect
@@ -11,16 +11,19 @@
 // pkg/front_end/testcases/bug31124.dart:1:5: Error: Previous declaration of 'a'.
 // var a = () => 'b';a();
 //     ^
+
+// Unhandled errors:
 //
-// pkg/front_end/testcases/bug31124.dart:1:1: Error: Duplicated name: a
+// pkg/front_end/testcases/bug31124.dart:1:22: Error: Expected a function body or '=>'.
+// Try adding {}.
 // var a = () => 'b';a();
-// ^
+//                      ^
+//
+// pkg/front_end/testcases/bug31124.dart:1:19: Error: 'a' is already declared in this scope.
+// var a = () => 'b';a();
+//                   ^
 
 library;
 import self as self;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/bug31124.dart:1:1: Error: Duplicated name: a
-var a = () => 'b';a();
-^";
-}
+static field dynamic a;
diff --git a/pkg/front_end/testcases/bug31124.dart.strong.transformed.expect b/pkg/front_end/testcases/bug31124.dart.strong.transformed.expect
index e470ed2..b75686c 100644
--- a/pkg/front_end/testcases/bug31124.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/bug31124.dart.strong.transformed.expect
@@ -1,8 +1,15 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/bug31124.dart:1:22: Error: Expected a function body or '=>'.
+// Try adding {}.
+// var a = () => 'b';a();
+//                      ^
+//
+// pkg/front_end/testcases/bug31124.dart:1:19: Error: 'a' is already declared in this scope.
+// var a = () => 'b';a();
+//                   ^
+
 library;
 import self as self;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/bug31124.dart:1:1: Error: Duplicated name: a
-var a = () => 'b';a();
-^";
-}
+static field dynamic a;
diff --git a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.direct.expect b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.direct.expect
index 408963b..0e2fda7 100644
--- a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.direct.expect
+++ b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.direct.expect
@@ -10,16 +10,29 @@
 // pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:16:7: Error: Previous declaration of 'A'.
 // class A {
 //       ^
+
+// Unhandled errors:
 //
-// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:16:9: Error: Duplicated name: A
-// class A {
-//         ^
+// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:21:1: Error: Expected '{' before this.
+// class B {}
+// ^^^^^
+//
+// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:20:1: Error: 'A' is already declared in this scope.
+// A()
+// ^
 
 library;
 import self as self;
+import "dart:core" as core;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:16:9: Error: Duplicated name: A
-class A {
-        ^";
+class A extends core::Object {
+  const constructor •() → void
+    : super core::Object::•()
+    ;
 }
+class B extends core::Object {
+  synthetic constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.direct.transformed.expect b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.direct.transformed.expect
index 7b807bd..a2f8868 100644
--- a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.direct.transformed.expect
@@ -1,8 +1,25 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:21:1: Error: Expected '{' before this.
+// class B {}
+// ^^^^^
+//
+// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:20:1: Error: 'A' is already declared in this scope.
+// A()
+// ^
+
 library;
 import self as self;
+import "dart:core" as core;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:16:9: Error: Duplicated name: A
-class A {
-        ^";
+class A extends core::Object {
+  const constructor •() → void
+    : super core::Object::•()
+    ;
 }
+class B extends core::Object {
+  synthetic constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.outline.expect b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.outline.expect
index d0250ed..c818405 100644
--- a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.outline.expect
+++ b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.outline.expect
@@ -23,7 +23,5 @@
   synthetic constructor •() → void
     ;
 }
-static method A() → dynamic
-  ;
 static method main() → dynamic
   ;
diff --git a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.strong.expect b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.strong.expect
index 408963b..0e2fda7 100644
--- a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.strong.expect
+++ b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.strong.expect
@@ -10,16 +10,29 @@
 // pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:16:7: Error: Previous declaration of 'A'.
 // class A {
 //       ^
+
+// Unhandled errors:
 //
-// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:16:9: Error: Duplicated name: A
-// class A {
-//         ^
+// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:21:1: Error: Expected '{' before this.
+// class B {}
+// ^^^^^
+//
+// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:20:1: Error: 'A' is already declared in this scope.
+// A()
+// ^
 
 library;
 import self as self;
+import "dart:core" as core;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:16:9: Error: Duplicated name: A
-class A {
-        ^";
+class A extends core::Object {
+  const constructor •() → void
+    : super core::Object::•()
+    ;
 }
+class B extends core::Object {
+  synthetic constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.strong.transformed.expect b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.strong.transformed.expect
index 7b807bd..a2f8868 100644
--- a/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart.strong.transformed.expect
@@ -1,8 +1,25 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:21:1: Error: Expected '{' before this.
+// class B {}
+// ^^^^^
+//
+// pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:20:1: Error: 'A' is already declared in this scope.
+// A()
+// ^
+
 library;
 import self as self;
+import "dart:core" as core;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/co19_language_metadata_syntax_t04.dart:16:9: Error: Duplicated name: A
-class A {
-        ^";
+class A extends core::Object {
+  const constructor •() → void
+    : super core::Object::•()
+    ;
 }
+class B extends core::Object {
+  synthetic constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/compile.status b/pkg/front_end/testcases/compile.status
index 8f7efbe..44960a5 100644
--- a/pkg/front_end/testcases/compile.status
+++ b/pkg/front_end/testcases/compile.status
@@ -8,9 +8,8 @@
 
 DeltaBlue: Fail # Fasta and dartk disagree on static initializers
 ambiguous_exports: RuntimeError # Expected, this file exports two main methods.
-bug31124: RuntimeError # Test has an intentional error
+bug31124: RuntimeError # Test has no main method (and we shouldn't add one).
 call: Fail # Test can't run.
-co19_language_metadata_syntax_t04: RuntimeError # Fasta doesn't recover well
 constructor_const_inference: RuntimeError # Test exercises strong mode semantics.  See also Issue #33813.
 external_import: RuntimeError # Expected -- test uses import which doesn't exist.
 fallthrough: Fail # Missing FallThroughError.
@@ -20,14 +19,12 @@
 inference/constructors_too_many_positional_arguments: Fail
 inference/downwards_inference_annotations_locals: Fail # Issue #30031
 inference/future_then_explicit_future: Fail
-inference/generic_methods_infer_js_builtin: Fail
+inference/generic_methods_infer_js_builtin: RuntimeError # Test attempts to access platform-private library leading to NSM.
 inference/infer_assign_to_index: Fail
 inference/infer_assign_to_property: Fail
 inference/infer_assign_to_property_custom: Fail
 inference/infer_type_cast: Fail
 inference/infer_typed_list_literal: Fail
-inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1: Fail
-inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1: Fail
 inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2: RuntimeError
 instantiate_to_bound/body_typedef_super_bounded_type: Fail # Issue 33444
 instantiate_to_bound/non_simple_class_parametrized_typedef_cycle: RuntimeError # May be related to Issue 33479
@@ -99,8 +96,8 @@
 redirecting_factory_typeparam_test: Fail # Missing support for RedirectingFactoryConstructor.
 redirecting_factory_typeparambounds_test: Fail # Missing support for RedirectingFactoryConstructor.
 regress/issue_29975: Fail # Issue 29975.
-regress/issue_29976: RuntimeError # Issue 29976.
-regress/issue_29982: Fail # Issue 29982.
+regress/issue_29976: RuntimeError # Tests runtime behavior of error recovery.
+regress/issue_29982: RuntimeError # Tests runtime behavior of error recovery.
 regress/issue_30836: RuntimeError # Issue 30836.
 regress/issue_32972: RuntimeError
 regress/issue_33452: RuntimeError # Test has an intentional error
diff --git a/pkg/front_end/testcases/duplicated_declarations.dart b/pkg/front_end/testcases/duplicated_declarations.dart
new file mode 100644
index 0000000..d971623
--- /dev/null
+++ b/pkg/front_end/testcases/duplicated_declarations.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2018, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+typedef Typedef = void Function();
+
+typedef Typedef = Object Function();
+
+typedef void OldTypedef();
+
+typedef Object OldTypedef();
+
+var field = "1st";
+
+var field = "2nd";
+
+main() {
+  "1st";
+}
+
+main() {
+  "2nd";
+}
+
+foo() {
+  main();
+  print(field);
+  C.s();
+}
+
+class C {
+  C(a);
+  C(a, b);
+  var field = "1st";
+
+  var field = "2nd";
+
+  m() {
+    "1st";
+  }
+
+  m() {
+    "2nd";
+  }
+
+  static s() {
+    "1st";
+  }
+
+  static s() {
+    "2nd";
+  }
+
+  static f() => s;
+}
+
+class Sub extends C {
+  Sub() : super(null);
+  m() => super.m();
+}
+
+class C {
+  C._();
+}
+
+enum Enum {
+  Enum,
+  a,
+  a,
+  b,
+}
+
+enum Enum {
+  a,
+  b,
+  c,
+}
+
+enum AnotherEnum {
+  a,
+  b,
+  c,
+  _name,
+  index,
+  toString,
+  values,
+}
+
+useAnotherEnum() {
+  <String, Object>{
+    "AnotherEnum.a": AnotherEnum.a,
+    "AnotherEnum.b": AnotherEnum.b,
+    "AnotherEnum.c": AnotherEnum.c,
+    "AnotherEnum._name": AnotherEnum._name,
+    "AnotherEnum.index": AnotherEnum.index,
+    "AnotherEnum.toString": AnotherEnum.toString,
+    "AnotherEnum.values": AnotherEnum.values,
+  };
+}
diff --git a/pkg/front_end/testcases/duplicated_declarations.dart.direct.expect b/pkg/front_end/testcases/duplicated_declarations.dart.direct.expect
new file mode 100644
index 0000000..df7e42f
--- /dev/null
+++ b/pkg/front_end/testcases/duplicated_declarations.dart.direct.expect
@@ -0,0 +1,325 @@
+// Formatted problems:
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:7:9: Error: 'Typedef' is already declared in this scope.
+// typedef Typedef = Object Function();
+//         ^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:5:9: Error: Previous declaration of 'Typedef'.
+// typedef Typedef = void Function();
+//         ^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:11:16: Error: 'OldTypedef' is already declared in this scope.
+// typedef Object OldTypedef();
+//                ^^^^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:9:14: Error: Previous declaration of 'OldTypedef'.
+// typedef void OldTypedef();
+//              ^^^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:15:5: Error: 'field' is already declared in this scope.
+// var field = "2nd";
+//     ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:13:5: Error: Previous declaration of 'field'.
+// var field = "1st";
+//     ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:21:1: Error: 'main' is already declared in this scope.
+// main() {
+// ^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:17:1: Error: Previous declaration of 'main'.
+// main() {
+// ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:33:3: Error: '' is already declared in this scope.
+//   C(a, b);
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:32:3: Error: Previous declaration of ''.
+//   C(a);
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:36:7: Error: 'field' is already declared in this scope.
+//   var field = "2nd";
+//       ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:34:7: Error: Previous declaration of 'field'.
+//   var field = "1st";
+//       ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:42:3: Error: 'm' is already declared in this scope.
+//   m() {
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:38:3: Error: Previous declaration of 'm'.
+//   m() {
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:50:10: Error: 's' is already declared in this scope.
+//   static s() {
+//          ^
+// pkg/front_end/testcases/duplicated_declarations.dart:46:10: Error: Previous declaration of 's'.
+//   static s() {
+//          ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:62:7: Error: 'C' is already declared in this scope.
+// class C {
+//       ^
+// pkg/front_end/testcases/duplicated_declarations.dart:31:7: Error: Previous declaration of 'C'.
+// class C {
+//       ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:67:3: Error: Name of enum constant 'Enum' can't be the same as the enum's own name.
+//   Enum,
+//   ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:69:3: Error: 'a' is already declared in this scope.
+//   a,
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:68:3: Error: Previous declaration of 'a'.
+//   a,
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:73:6: Error: 'Enum' is already declared in this scope.
+// enum Enum {
+//      ^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:66:6: Error: Previous declaration of 'Enum'.
+// enum Enum {
+//      ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:83:3: Error: '_name' is already declared in this scope.
+//   _name,
+//   ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of '_name'.
+// enum AnotherEnum {
+//      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:84:3: Error: 'index' is already declared in this scope.
+//   index,
+//   ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'index'.
+// enum AnotherEnum {
+//      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:85:3: Error: 'toString' is already declared in this scope.
+//   toString,
+//   ^^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'toString'.
+// enum AnotherEnum {
+//      ^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:86:3: Error: 'values' is already declared in this scope.
+//   values,
+//   ^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'values'.
+// enum AnotherEnum {
+//      ^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:57:19: Error: Type 'C' not found.
+// class Sub extends C {
+//                   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:26:3: Error: Can't use 'main' because it is declared more than once.
+//   main();
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:27:9: Error: Can't use 'field' because it is declared more than once.
+//   print(field);
+//         ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:28:3: Error: Can't use 'C' because it is declared more than once.
+//   C.s();
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:54:17: Error: Can't use 's' because it is declared more than once.
+//   static f() => s;
+//                 ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:58:16: Warning: Too many positional arguments: 0 allowed, but 1 found.
+// Try removing the extra positional arguments.
+//   Sub() : super(null);
+//                ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:59:16: Warning: Superclass has no method named 'm'.
+//   m() => super.m();
+//                ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:94:38: Error: Can't use '_name' because it is declared more than once.
+//     "AnotherEnum._name": AnotherEnum._name,
+//                                      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:95:38: Error: Can't use 'index' because it is declared more than once.
+//     "AnotherEnum.index": AnotherEnum.index,
+//                                      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:96:41: Error: Can't use 'toString' because it is declared more than once.
+//     "AnotherEnum.toString": AnotherEnum.toString,
+//                                         ^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:97:39: Error: Can't use 'values' because it is declared more than once.
+//     "AnotherEnum.values": AnotherEnum.values,
+//                                       ^^^^^^
+
+// Unhandled errors:
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:7:9: Error: 'Typedef' is already declared in this scope.
+// typedef Typedef = Object Function();
+//         ^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:11:16: Error: 'OldTypedef' is already declared in this scope.
+// typedef Object OldTypedef();
+//                ^^^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:15:5: Error: 'field' is already declared in this scope.
+// var field = "2nd";
+//     ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:21:1: Error: 'main' is already declared in this scope.
+// main() {
+// ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:33:3: Error: '' is already declared in this scope.
+//   C(a, b);
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:36:7: Error: 'field' is already declared in this scope.
+//   var field = "2nd";
+//       ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:42:3: Error: 'm' is already declared in this scope.
+//   m() {
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:50:10: Error: 's' is already declared in this scope.
+//   static s() {
+//          ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:62:7: Error: 'C' is already declared in this scope.
+// class C {
+//       ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:67:3: Error: Name of enum constant 'Enum' can't be the same as the enum's own name.
+//   Enum,
+//   ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:69:3: Error: 'a' is already declared in this scope.
+//   a,
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:73:6: Error: 'Enum' is already declared in this scope.
+// enum Enum {
+//      ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:83:3: Error: '_name' is already declared in this scope.
+//   _name,
+//   ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:84:3: Error: 'index' is already declared in this scope.
+//   index,
+//   ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:85:3: Error: 'toString' is already declared in this scope.
+//   toString,
+//   ^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:86:3: Error: 'values' is already declared in this scope.
+//   values,
+//   ^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:57:19: Error: Type 'C' not found.
+// class Sub extends C {
+//                   ^
+
+library;
+import self as self;
+import "dart:core" as core;
+
+typedef Typedef = () → void;
+typedef OldTypedef = () → void;
+class C#1 extends core::Object {
+  constructor _() → void
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  field dynamic field;
+  constructor •(dynamic a) → void
+    : super core::Object::•()
+    ;
+  method m() → dynamic {
+    "1st";
+  }
+  static method s() → dynamic {
+    "1st";
+  }
+  static method f() → dynamic
+    return invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:54:17: Error: Can't use 's' because it is declared more than once.
+  static f() => s;
+                ^";
+}
+class Sub extends core::Object {
+  constructor •() → void
+    : final dynamic #t1 = throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#, 0, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[null]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))
+    ;
+  method m() → dynamic
+    return super.m();
+}
+class Enum#1 extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::Enum#1> values = const <self::Enum#1>[self::Enum#1::a, self::Enum#1::b, self::Enum#1::c];
+  static const field self::Enum#1 a = const self::Enum#1::•(0, "Enum.a");
+  static const field self::Enum#1 b = const self::Enum#1::•(1, "Enum.b");
+  static const field self::Enum#1 c = const self::Enum#1::•(2, "Enum.c");
+  const constructor •(core::int index, core::String _name) → void
+    : self::Enum#1::index = index, self::Enum#1::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::Enum#1::_name};
+}
+class Enum extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::Enum> values = const <self::Enum>[self::Enum::Enum, self::Enum::a, self::Enum::b];
+  static const field self::Enum Enum = const self::Enum::•(0, "Enum.Enum");
+  static const field self::Enum a = const self::Enum::•(1, "Enum.a");
+  static const field self::Enum b = const self::Enum::•(2, "Enum.b");
+  const constructor •(core::int index, core::String _name) → void
+    : self::Enum::index = index, self::Enum::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::Enum::_name};
+}
+class AnotherEnum extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::AnotherEnum> values = const <self::AnotherEnum>[self::AnotherEnum::a, self::AnotherEnum::b, self::AnotherEnum::c];
+  static const field self::AnotherEnum a = const self::AnotherEnum::•(0, "AnotherEnum.a");
+  static const field self::AnotherEnum b = const self::AnotherEnum::•(1, "AnotherEnum.b");
+  static const field self::AnotherEnum c = const self::AnotherEnum::•(2, "AnotherEnum.c");
+  const constructor •(core::int index, core::String _name) → void
+    : self::AnotherEnum::index = index, self::AnotherEnum::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::AnotherEnum::_name};
+}
+static field dynamic field;
+static method main() → dynamic {
+  "1st";
+}
+static method foo() → dynamic {
+  invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:26:3: Error: Can't use 'main' because it is declared more than once.
+  main();
+  ^".call();
+  core::print(invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:27:9: Error: Can't use 'field' because it is declared more than once.
+  print(field);
+        ^");
+  invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:28:3: Error: Can't use 'C' because it is declared more than once.
+  C.s();
+  ^".s();
+}
+static method useAnotherEnum() → dynamic {
+  <core::String, core::Object>{"AnotherEnum.a": self::AnotherEnum::a, "AnotherEnum.b": self::AnotherEnum::b, "AnotherEnum.c": self::AnotherEnum::c, "AnotherEnum._name": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:94:38: Error: Can't use '_name' because it is declared more than once.
+    \"AnotherEnum._name\": AnotherEnum._name,
+                                     ^^^^^", "AnotherEnum.index": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:95:38: Error: Can't use 'index' because it is declared more than once.
+    \"AnotherEnum.index\": AnotherEnum.index,
+                                     ^^^^^", "AnotherEnum.toString": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:96:41: Error: Can't use 'toString' because it is declared more than once.
+    \"AnotherEnum.toString\": AnotherEnum.toString,
+                                        ^^^^^^^^", "AnotherEnum.values": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:97:39: Error: Can't use 'values' because it is declared more than once.
+    \"AnotherEnum.values\": AnotherEnum.values,
+                                      ^^^^^^"};
+}
diff --git a/pkg/front_end/testcases/duplicated_declarations.dart.direct.transformed.expect b/pkg/front_end/testcases/duplicated_declarations.dart.direct.transformed.expect
new file mode 100644
index 0000000..f583777
--- /dev/null
+++ b/pkg/front_end/testcases/duplicated_declarations.dart.direct.transformed.expect
@@ -0,0 +1,169 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:7:9: Error: 'Typedef' is already declared in this scope.
+// typedef Typedef = Object Function();
+//         ^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:11:16: Error: 'OldTypedef' is already declared in this scope.
+// typedef Object OldTypedef();
+//                ^^^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:15:5: Error: 'field' is already declared in this scope.
+// var field = "2nd";
+//     ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:21:1: Error: 'main' is already declared in this scope.
+// main() {
+// ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:33:3: Error: '' is already declared in this scope.
+//   C(a, b);
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:36:7: Error: 'field' is already declared in this scope.
+//   var field = "2nd";
+//       ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:42:3: Error: 'm' is already declared in this scope.
+//   m() {
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:50:10: Error: 's' is already declared in this scope.
+//   static s() {
+//          ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:62:7: Error: 'C' is already declared in this scope.
+// class C {
+//       ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:67:3: Error: Name of enum constant 'Enum' can't be the same as the enum's own name.
+//   Enum,
+//   ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:69:3: Error: 'a' is already declared in this scope.
+//   a,
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:73:6: Error: 'Enum' is already declared in this scope.
+// enum Enum {
+//      ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:83:3: Error: '_name' is already declared in this scope.
+//   _name,
+//   ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:84:3: Error: 'index' is already declared in this scope.
+//   index,
+//   ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:85:3: Error: 'toString' is already declared in this scope.
+//   toString,
+//   ^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:86:3: Error: 'values' is already declared in this scope.
+//   values,
+//   ^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:57:19: Error: Type 'C' not found.
+// class Sub extends C {
+//                   ^
+
+library;
+import self as self;
+import "dart:core" as core;
+
+typedef Typedef = () → void;
+typedef OldTypedef = () → void;
+class C#1 extends core::Object {
+  constructor _() → void
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  field dynamic field;
+  constructor •(dynamic a) → void
+    : super core::Object::•()
+    ;
+  method m() → dynamic {
+    "1st";
+  }
+  static method s() → dynamic {
+    "1st";
+  }
+  static method f() → dynamic
+    return invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:54:17: Error: Can't use 's' because it is declared more than once.
+  static f() => s;
+                ^";
+}
+class Sub extends core::Object {
+  constructor •() → void
+    : final dynamic #t1 = throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#, 0, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[null]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))
+    ;
+  method m() → dynamic
+    return super.m();
+}
+class Enum#1 extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::Enum#1> values = const <self::Enum#1>[self::Enum#1::a, self::Enum#1::b, self::Enum#1::c];
+  static const field self::Enum#1 a = const self::Enum#1::•(0, "Enum.a");
+  static const field self::Enum#1 b = const self::Enum#1::•(1, "Enum.b");
+  static const field self::Enum#1 c = const self::Enum#1::•(2, "Enum.c");
+  const constructor •(core::int index, core::String _name) → void
+    : self::Enum#1::index = index, self::Enum#1::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::Enum#1::_name};
+}
+class Enum extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::Enum> values = const <self::Enum>[self::Enum::Enum, self::Enum::a, self::Enum::b];
+  static const field self::Enum Enum = const self::Enum::•(0, "Enum.Enum");
+  static const field self::Enum a = const self::Enum::•(1, "Enum.a");
+  static const field self::Enum b = const self::Enum::•(2, "Enum.b");
+  const constructor •(core::int index, core::String _name) → void
+    : self::Enum::index = index, self::Enum::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::Enum::_name};
+}
+class AnotherEnum extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::AnotherEnum> values = const <self::AnotherEnum>[self::AnotherEnum::a, self::AnotherEnum::b, self::AnotherEnum::c];
+  static const field self::AnotherEnum a = const self::AnotherEnum::•(0, "AnotherEnum.a");
+  static const field self::AnotherEnum b = const self::AnotherEnum::•(1, "AnotherEnum.b");
+  static const field self::AnotherEnum c = const self::AnotherEnum::•(2, "AnotherEnum.c");
+  const constructor •(core::int index, core::String _name) → void
+    : self::AnotherEnum::index = index, self::AnotherEnum::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::AnotherEnum::_name};
+}
+static field dynamic field;
+static method main() → dynamic {
+  "1st";
+}
+static method foo() → dynamic {
+  invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:26:3: Error: Can't use 'main' because it is declared more than once.
+  main();
+  ^".call();
+  core::print(invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:27:9: Error: Can't use 'field' because it is declared more than once.
+  print(field);
+        ^");
+  invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:28:3: Error: Can't use 'C' because it is declared more than once.
+  C.s();
+  ^".s();
+}
+static method useAnotherEnum() → dynamic {
+  <core::String, core::Object>{"AnotherEnum.a": self::AnotherEnum::a, "AnotherEnum.b": self::AnotherEnum::b, "AnotherEnum.c": self::AnotherEnum::c, "AnotherEnum._name": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:94:38: Error: Can't use '_name' because it is declared more than once.
+    \"AnotherEnum._name\": AnotherEnum._name,
+                                     ^^^^^", "AnotherEnum.index": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:95:38: Error: Can't use 'index' because it is declared more than once.
+    \"AnotherEnum.index\": AnotherEnum.index,
+                                     ^^^^^", "AnotherEnum.toString": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:96:41: Error: Can't use 'toString' because it is declared more than once.
+    \"AnotherEnum.toString\": AnotherEnum.toString,
+                                        ^^^^^^^^", "AnotherEnum.values": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:97:39: Error: Can't use 'values' because it is declared more than once.
+    \"AnotherEnum.values\": AnotherEnum.values,
+                                      ^^^^^^"};
+}
diff --git a/pkg/front_end/testcases/duplicated_declarations.dart.outline.expect b/pkg/front_end/testcases/duplicated_declarations.dart.outline.expect
new file mode 100644
index 0000000..aa488b8
--- /dev/null
+++ b/pkg/front_end/testcases/duplicated_declarations.dart.outline.expect
@@ -0,0 +1,188 @@
+// Formatted problems:
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:7:9: Error: 'Typedef' is already declared in this scope.
+// typedef Typedef = Object Function();
+//         ^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:5:9: Error: Previous declaration of 'Typedef'.
+// typedef Typedef = void Function();
+//         ^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:11:16: Error: 'OldTypedef' is already declared in this scope.
+// typedef Object OldTypedef();
+//                ^^^^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:9:14: Error: Previous declaration of 'OldTypedef'.
+// typedef void OldTypedef();
+//              ^^^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:15:5: Error: 'field' is already declared in this scope.
+// var field = "2nd";
+//     ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:13:5: Error: Previous declaration of 'field'.
+// var field = "1st";
+//     ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:21:1: Error: 'main' is already declared in this scope.
+// main() {
+// ^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:17:1: Error: Previous declaration of 'main'.
+// main() {
+// ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:33:3: Error: '' is already declared in this scope.
+//   C(a, b);
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:32:3: Error: Previous declaration of ''.
+//   C(a);
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:36:7: Error: 'field' is already declared in this scope.
+//   var field = "2nd";
+//       ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:34:7: Error: Previous declaration of 'field'.
+//   var field = "1st";
+//       ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:42:3: Error: 'm' is already declared in this scope.
+//   m() {
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:38:3: Error: Previous declaration of 'm'.
+//   m() {
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:50:10: Error: 's' is already declared in this scope.
+//   static s() {
+//          ^
+// pkg/front_end/testcases/duplicated_declarations.dart:46:10: Error: Previous declaration of 's'.
+//   static s() {
+//          ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:62:7: Error: 'C' is already declared in this scope.
+// class C {
+//       ^
+// pkg/front_end/testcases/duplicated_declarations.dart:31:7: Error: Previous declaration of 'C'.
+// class C {
+//       ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:67:3: Error: Name of enum constant 'Enum' can't be the same as the enum's own name.
+//   Enum,
+//   ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:69:3: Error: 'a' is already declared in this scope.
+//   a,
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:68:3: Error: Previous declaration of 'a'.
+//   a,
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:73:6: Error: 'Enum' is already declared in this scope.
+// enum Enum {
+//      ^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:66:6: Error: Previous declaration of 'Enum'.
+// enum Enum {
+//      ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:83:3: Error: '_name' is already declared in this scope.
+//   _name,
+//   ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of '_name'.
+// enum AnotherEnum {
+//      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:84:3: Error: 'index' is already declared in this scope.
+//   index,
+//   ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'index'.
+// enum AnotherEnum {
+//      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:85:3: Error: 'toString' is already declared in this scope.
+//   toString,
+//   ^^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'toString'.
+// enum AnotherEnum {
+//      ^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:86:3: Error: 'values' is already declared in this scope.
+//   values,
+//   ^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'values'.
+// enum AnotherEnum {
+//      ^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:57:19: Error: Type 'C' not found.
+// class Sub extends C {
+//                   ^
+
+library;
+import self as self;
+import "dart:core" as core;
+
+typedef Typedef = () → void;
+typedef OldTypedef = () → void;
+class C#1 extends core::Object {
+  constructor _() → void
+    ;
+}
+class C extends core::Object {
+  field dynamic field;
+  constructor •(dynamic a) → void
+    ;
+  method m() → dynamic
+    ;
+  static method s() → dynamic
+    ;
+  static method f() → dynamic
+    ;
+}
+class Sub extends core::Object {
+  constructor •() → void
+    ;
+  method m() → dynamic
+    ;
+}
+class Enum#1 extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::Enum#1> values = const <self::Enum#1>[self::Enum#1::a, self::Enum#1::b, self::Enum#1::c];
+  static const field self::Enum#1 a = const self::Enum#1::•(0, "Enum.a");
+  static const field self::Enum#1 b = const self::Enum#1::•(1, "Enum.b");
+  static const field self::Enum#1 c = const self::Enum#1::•(2, "Enum.c");
+  const constructor •(core::int index, core::String _name) → void
+    : self::Enum#1::index = index, self::Enum#1::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::Enum#1::_name};
+}
+class Enum extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::Enum> values = const <self::Enum>[self::Enum::Enum, self::Enum::a, self::Enum::b];
+  static const field self::Enum Enum = const self::Enum::•(0, "Enum.Enum");
+  static const field self::Enum a = const self::Enum::•(1, "Enum.a");
+  static const field self::Enum b = const self::Enum::•(2, "Enum.b");
+  const constructor •(core::int index, core::String _name) → void
+    : self::Enum::index = index, self::Enum::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::Enum::_name};
+}
+class AnotherEnum extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::AnotherEnum> values = const <self::AnotherEnum>[self::AnotherEnum::a, self::AnotherEnum::b, self::AnotherEnum::c];
+  static const field self::AnotherEnum a = const self::AnotherEnum::•(0, "AnotherEnum.a");
+  static const field self::AnotherEnum b = const self::AnotherEnum::•(1, "AnotherEnum.b");
+  static const field self::AnotherEnum c = const self::AnotherEnum::•(2, "AnotherEnum.c");
+  const constructor •(core::int index, core::String _name) → void
+    : self::AnotherEnum::index = index, self::AnotherEnum::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::AnotherEnum::_name};
+}
+static field dynamic field;
+static method main() → dynamic
+  ;
+static method foo() → dynamic
+  ;
+static method useAnotherEnum() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/duplicated_declarations.dart.strong.expect b/pkg/front_end/testcases/duplicated_declarations.dart.strong.expect
new file mode 100644
index 0000000..7e56c2c
--- /dev/null
+++ b/pkg/front_end/testcases/duplicated_declarations.dart.strong.expect
@@ -0,0 +1,334 @@
+// Formatted problems:
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:7:9: Error: 'Typedef' is already declared in this scope.
+// typedef Typedef = Object Function();
+//         ^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:5:9: Error: Previous declaration of 'Typedef'.
+// typedef Typedef = void Function();
+//         ^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:11:16: Error: 'OldTypedef' is already declared in this scope.
+// typedef Object OldTypedef();
+//                ^^^^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:9:14: Error: Previous declaration of 'OldTypedef'.
+// typedef void OldTypedef();
+//              ^^^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:15:5: Error: 'field' is already declared in this scope.
+// var field = "2nd";
+//     ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:13:5: Error: Previous declaration of 'field'.
+// var field = "1st";
+//     ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:21:1: Error: 'main' is already declared in this scope.
+// main() {
+// ^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:17:1: Error: Previous declaration of 'main'.
+// main() {
+// ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:33:3: Error: '' is already declared in this scope.
+//   C(a, b);
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:32:3: Error: Previous declaration of ''.
+//   C(a);
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:36:7: Error: 'field' is already declared in this scope.
+//   var field = "2nd";
+//       ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:34:7: Error: Previous declaration of 'field'.
+//   var field = "1st";
+//       ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:42:3: Error: 'm' is already declared in this scope.
+//   m() {
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:38:3: Error: Previous declaration of 'm'.
+//   m() {
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:50:10: Error: 's' is already declared in this scope.
+//   static s() {
+//          ^
+// pkg/front_end/testcases/duplicated_declarations.dart:46:10: Error: Previous declaration of 's'.
+//   static s() {
+//          ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:62:7: Error: 'C' is already declared in this scope.
+// class C {
+//       ^
+// pkg/front_end/testcases/duplicated_declarations.dart:31:7: Error: Previous declaration of 'C'.
+// class C {
+//       ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:67:3: Error: Name of enum constant 'Enum' can't be the same as the enum's own name.
+//   Enum,
+//   ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:69:3: Error: 'a' is already declared in this scope.
+//   a,
+//   ^
+// pkg/front_end/testcases/duplicated_declarations.dart:68:3: Error: Previous declaration of 'a'.
+//   a,
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:73:6: Error: 'Enum' is already declared in this scope.
+// enum Enum {
+//      ^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:66:6: Error: Previous declaration of 'Enum'.
+// enum Enum {
+//      ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:83:3: Error: '_name' is already declared in this scope.
+//   _name,
+//   ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of '_name'.
+// enum AnotherEnum {
+//      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:84:3: Error: 'index' is already declared in this scope.
+//   index,
+//   ^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'index'.
+// enum AnotherEnum {
+//      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:85:3: Error: 'toString' is already declared in this scope.
+//   toString,
+//   ^^^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'toString'.
+// enum AnotherEnum {
+//      ^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:86:3: Error: 'values' is already declared in this scope.
+//   values,
+//   ^^^^^^
+// pkg/front_end/testcases/duplicated_declarations.dart:79:6: Error: Previous declaration of 'values'.
+// enum AnotherEnum {
+//      ^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:57:19: Error: Type 'C' not found.
+// class Sub extends C {
+//                   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:26:3: Error: Can't use 'main' because it is declared more than once.
+//   main();
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:27:9: Error: Can't use 'field' because it is declared more than once.
+//   print(field);
+//         ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:28:3: Error: Can't use 'C' because it is declared more than once.
+//   C.s();
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:54:17: Error: Can't use 's' because it is declared more than once.
+//   static f() => s;
+//                 ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:58:16: Error: Too many positional arguments: 0 allowed, but 1 found.
+// Try removing the extra positional arguments.
+//   Sub() : super(null);
+//                ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:59:16: Error: Superclass has no method named 'm'.
+//   m() => super.m();
+//                ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:94:38: Error: Can't use '_name' because it is declared more than once.
+//     "AnotherEnum._name": AnotherEnum._name,
+//                                      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:95:38: Error: Can't use 'index' because it is declared more than once.
+//     "AnotherEnum.index": AnotherEnum.index,
+//                                      ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:96:41: Error: Can't use 'toString' because it is declared more than once.
+//     "AnotherEnum.toString": AnotherEnum.toString,
+//                                         ^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:97:39: Error: Can't use 'values' because it is declared more than once.
+//     "AnotherEnum.values": AnotherEnum.values,
+//                                       ^^^^^^
+
+// Unhandled errors:
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:7:9: Error: 'Typedef' is already declared in this scope.
+// typedef Typedef = Object Function();
+//         ^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:11:16: Error: 'OldTypedef' is already declared in this scope.
+// typedef Object OldTypedef();
+//                ^^^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:15:5: Error: 'field' is already declared in this scope.
+// var field = "2nd";
+//     ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:21:1: Error: 'main' is already declared in this scope.
+// main() {
+// ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:33:3: Error: '' is already declared in this scope.
+//   C(a, b);
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:36:7: Error: 'field' is already declared in this scope.
+//   var field = "2nd";
+//       ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:42:3: Error: 'm' is already declared in this scope.
+//   m() {
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:50:10: Error: 's' is already declared in this scope.
+//   static s() {
+//          ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:62:7: Error: 'C' is already declared in this scope.
+// class C {
+//       ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:67:3: Error: Name of enum constant 'Enum' can't be the same as the enum's own name.
+//   Enum,
+//   ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:69:3: Error: 'a' is already declared in this scope.
+//   a,
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:73:6: Error: 'Enum' is already declared in this scope.
+// enum Enum {
+//      ^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:83:3: Error: '_name' is already declared in this scope.
+//   _name,
+//   ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:84:3: Error: 'index' is already declared in this scope.
+//   index,
+//   ^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:85:3: Error: 'toString' is already declared in this scope.
+//   toString,
+//   ^^^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:86:3: Error: 'values' is already declared in this scope.
+//   values,
+//   ^^^^^^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:57:19: Error: Type 'C' not found.
+// class Sub extends C {
+//                   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:58:16: Error: Too many positional arguments: 0 allowed, but 1 found.
+// Try removing the extra positional arguments.
+//   Sub() : super(null);
+//                ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:59:16: Error: Superclass has no method named 'm'.
+//   m() => super.m();
+//                ^
+
+library;
+import self as self;
+import "dart:core" as core;
+
+typedef Typedef = () → void;
+typedef OldTypedef = () → void;
+class C#1 extends core::Object {
+  constructor _() → void
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  field dynamic field;
+  constructor •(dynamic a) → void
+    : super core::Object::•()
+    ;
+  method m() → dynamic {
+    "1st";
+  }
+  static method s() → dynamic {
+    "1st";
+  }
+  static method f() → dynamic
+    return invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:54:17: Error: Can't use 's' because it is declared more than once.
+  static f() => s;
+                ^";
+}
+class Sub extends core::Object {
+  constructor •() → void
+    : final dynamic #t1 = throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#, 0, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[null]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))
+    ;
+  method m() → dynamic
+    return super.m();
+}
+class Enum#1 extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::Enum#1> values = const <self::Enum#1>[self::Enum#1::a, self::Enum#1::b, self::Enum#1::c];
+  static const field self::Enum#1 a = const self::Enum#1::•(0, "Enum.a");
+  static const field self::Enum#1 b = const self::Enum#1::•(1, "Enum.b");
+  static const field self::Enum#1 c = const self::Enum#1::•(2, "Enum.c");
+  const constructor •(core::int index, core::String _name) → void
+    : self::Enum#1::index = index, self::Enum#1::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::Enum#1::_name};
+}
+class Enum extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::Enum> values = const <self::Enum>[self::Enum::Enum, self::Enum::a, self::Enum::b];
+  static const field self::Enum Enum = const self::Enum::•(0, "Enum.Enum");
+  static const field self::Enum a = const self::Enum::•(1, "Enum.a");
+  static const field self::Enum b = const self::Enum::•(2, "Enum.b");
+  const constructor •(core::int index, core::String _name) → void
+    : self::Enum::index = index, self::Enum::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::Enum::_name};
+}
+class AnotherEnum extends core::Object {
+  final field core::int index;
+  final field core::String _name;
+  static const field core::List<self::AnotherEnum> values = const <self::AnotherEnum>[self::AnotherEnum::a, self::AnotherEnum::b, self::AnotherEnum::c];
+  static const field self::AnotherEnum a = const self::AnotherEnum::•(0, "AnotherEnum.a");
+  static const field self::AnotherEnum b = const self::AnotherEnum::•(1, "AnotherEnum.b");
+  static const field self::AnotherEnum c = const self::AnotherEnum::•(2, "AnotherEnum.c");
+  const constructor •(core::int index, core::String _name) → void
+    : self::AnotherEnum::index = index, self::AnotherEnum::_name = _name, super core::Object::•()
+    ;
+  method toString() → core::String
+    return this.{=self::AnotherEnum::_name};
+}
+static field dynamic field;
+static method main() → dynamic {
+  "1st";
+}
+static method foo() → dynamic {
+  invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:26:3: Error: Can't use 'main' because it is declared more than once.
+  main();
+  ^".call();
+  core::print(invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:27:9: Error: Can't use 'field' because it is declared more than once.
+  print(field);
+        ^");
+  invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:28:3: Error: Can't use 'C' because it is declared more than once.
+  C.s();
+  ^".s();
+}
+static method useAnotherEnum() → dynamic {
+  <core::String, core::Object>{"AnotherEnum.a": self::AnotherEnum::a, "AnotherEnum.b": self::AnotherEnum::b, "AnotherEnum.c": self::AnotherEnum::c, "AnotherEnum._name": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:94:38: Error: Can't use '_name' because it is declared more than once.
+    \"AnotherEnum._name\": AnotherEnum._name,
+                                     ^^^^^", "AnotherEnum.index": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:95:38: Error: Can't use 'index' because it is declared more than once.
+    \"AnotherEnum.index\": AnotherEnum.index,
+                                     ^^^^^", "AnotherEnum.toString": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:96:41: Error: Can't use 'toString' because it is declared more than once.
+    \"AnotherEnum.toString\": AnotherEnum.toString,
+                                        ^^^^^^^^", "AnotherEnum.values": invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:97:39: Error: Can't use 'values' because it is declared more than once.
+    \"AnotherEnum.values\": AnotherEnum.values,
+                                      ^^^^^^"};
+}
diff --git a/pkg/front_end/testcases/duplicated_declarations.dart.strong.transformed.expect b/pkg/front_end/testcases/duplicated_declarations.dart.strong.transformed.expect
new file mode 100644
index 0000000..a61366d
--- /dev/null
+++ b/pkg/front_end/testcases/duplicated_declarations.dart.strong.transformed.expect
@@ -0,0 +1,76 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:7:9: Error: Duplicated definition of 'Typedef'.
+// typedef Typedef = Object Function();
+//         ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:11:16: Error: Duplicated definition of 'OldTypedef'.
+// typedef Object OldTypedef();
+//                ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:15:5: Error: Duplicated definition of 'field'.
+// var field = "2nd";
+//     ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:21:1: Error: Duplicated definition of 'main'.
+// main() {
+// ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:33:3: Error: Duplicated definition of ''.
+//   C(a, b);
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:36:7: Error: Duplicated definition of 'field'.
+//   var field = "2nd";
+//       ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:42:3: Error: Duplicated definition of 'm'.
+//   m() {
+//   ^
+//
+// pkg/front_end/testcases/duplicated_declarations.dart:50:10: Error: Duplicated definition of 's'.
+//   static s() {
+//          ^
+
+library;
+import self as self;
+import "dart:core" as core;
+
+typedef Typedef = () → void;
+typedef OldTypedef = () → void;
+class C extends core::Object {
+  field dynamic field = null;
+  constructor •(dynamic a) → void
+    : super core::Object::•()
+    ;
+  method m() → dynamic {
+    "1st";
+  }
+  static method s() → dynamic {
+    "1st";
+  }
+  static method f() → dynamic
+    return invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:54:17: Error: 's' is already declared in this scope.
+  static f() => s;
+                ^";
+}
+class Sub extends self::C {
+  constructor •() → void
+    : super self::C::•(null)
+    ;
+  method m() → dynamic
+    return super.{self::C::m}();
+}
+static field dynamic field;
+static method main() → dynamic {
+  "1st";
+}
+static method foo() → dynamic {
+  invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:26:3: Error: 'main' is already declared in this scope.
+  main();
+  ^".call();
+  core::print(invalid-expression "pkg/front_end/testcases/duplicated_declarations.dart:27:9: Error: 'field' is already declared in this scope.
+  print(field);
+        ^");
+  self::C::s();
+}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.direct.expect
index 2d25757..5b0e517 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.direct.expect
@@ -1,6 +1,38 @@
-library;
-import self as self;
+// Formatted problems:
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:8:42: Error: Can't access platform private library.
+// /*error:IMPORT_INTERNAL_LIBRARY*/ import 'dart:_foreign_helper' show JS;
+//                                          ^
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:8:42: Error: Not found: 'dart:_foreign_helper'
+// /*error:IMPORT_INTERNAL_LIBRARY*/ import 'dart:_foreign_helper' show JS;
+//                                          ^
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:11:43: Warning: Method not found: 'JS'.
+//   String x = /*error:INVALID_ASSIGNMENT*/ JS('int', '42');
+//                                           ^^
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:12:28: Warning: Method not found: 'JS'.
+//   var /*@type=String*/ y = JS('String', '"hello"');
+//                            ^^
 
-static method #main() → dynamic {
-  throw "dart:_foreign_helper: Error: Not found: dart:_foreign_helper.";
+// Unhandled errors:
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:8:42: Error: Can't access platform private library.
+// /*error:IMPORT_INTERNAL_LIBRARY*/ import 'dart:_foreign_helper' show JS;
+//                                          ^
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:8:42: Error: Not found: 'dart:_foreign_helper'
+// /*error:IMPORT_INTERNAL_LIBRARY*/ import 'dart:_foreign_helper' show JS;
+//                                          ^
+
+library test;
+import self as self;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::String x = throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#JS, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["int", "42"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+  dynamic y = throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#JS, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["String", "\"hello\""]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+  y = "world";
+  y = 42;
 }
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.direct.transformed.expect
new file mode 100644
index 0000000..89adde8
--- /dev/null
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.direct.transformed.expect
@@ -0,0 +1,20 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:8:42: Error: Can't access platform private library.
+// /*error:IMPORT_INTERNAL_LIBRARY*/ import 'dart:_foreign_helper' show JS;
+//                                          ^
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:8:42: Error: Not found: 'dart:_foreign_helper'
+// /*error:IMPORT_INTERNAL_LIBRARY*/ import 'dart:_foreign_helper' show JS;
+//                                          ^
+
+library test;
+import self as self;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::String x = throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#JS, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["int", "42"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+  dynamic y = throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#JS, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["String", "\"hello\""]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+  y = "world";
+  y = 42;
+}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.outline.expect b/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.outline.expect
new file mode 100644
index 0000000..ce6b792
--- /dev/null
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart.outline.expect
@@ -0,0 +1,15 @@
+// Formatted problems:
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:8:42: Error: Can't access platform private library.
+// /*error:IMPORT_INTERNAL_LIBRARY*/ import 'dart:_foreign_helper' show JS;
+//                                          ^
+//
+// pkg/front_end/testcases/inference/generic_methods_infer_js_builtin.dart:8:42: Error: Not found: 'dart:_foreign_helper'
+// /*error:IMPORT_INTERNAL_LIBRARY*/ import 'dart:_foreign_helper' show JS;
+//                                          ^
+
+library test;
+import self as self;
+
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart
index 84e190d..fcb3945 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart
@@ -8,3 +8,4 @@
 List<T> f<T>(T g()) => <T>[g()];
 var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
 
+main() {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.direct.expect
index 999be87..3cdb4282 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.direct.expect
@@ -1,6 +1,36 @@
-library;
-import self as self;
+// Formatted problems:
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:39: Error: An equality expression can't be an operand of another equality expression.
+// Try re-writing the expression.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                       ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:40: Error: Expected an identifier, but got ')'.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                        ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:40: Warning: Getter not found: ''.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                        ^
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:39: Error: Unexpected token '>'.\nvar /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });\n                                      ^";
-}
+// Unhandled errors:
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:39: Error: An equality expression can't be an operand of another equality expression.
+// Try re-writing the expression.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                       ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:40: Error: Expected an identifier, but got ')'.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                        ^
+
+library test;
+import self as self;
+import "dart:core" as core;
+
+static field dynamic v = self::f.<(dynamic).>(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).call(() → dynamic {
+  return 1;
+});
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
+  return <self::f::T>[g.call()];
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.direct.transformed.expect
new file mode 100644
index 0000000..1b87566
--- /dev/null
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.direct.transformed.expect
@@ -0,0 +1,21 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:39: Error: An equality expression can't be an operand of another equality expression.
+// Try re-writing the expression.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                       ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:40: Error: Expected an identifier, but got ')'.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                        ^
+
+library test;
+import self as self;
+import "dart:core" as core;
+
+static field dynamic v = self::f.<(dynamic).>(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).call(() → dynamic {
+  return 1;
+});
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
+  return <self::f::T>[g.call()];
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.outline.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.outline.expect
new file mode 100644
index 0000000..03bbeef
--- /dev/null
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.outline.expect
@@ -0,0 +1,24 @@
+// Formatted problems:
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:39: Error: An equality expression can't be an operand of another equality expression.
+// Try re-writing the expression.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                       ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:40: Error: Expected an identifier, but got ')'.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                        ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:40: Warning: Getter not found: ''.
+// var /*@topType=dynamic*/v = (f<dynamic>)(() { return 1; });
+//                                        ^
+
+library test;
+import self as self;
+import "dart:core" as core;
+
+static field dynamic v;
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
+  ;
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart
index 48fff69a..761fe2a 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart
@@ -8,3 +8,4 @@
 List<T> f<T>(T g()) => <T>[g()];
 var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
 
+main() {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.direct.expect
index f26e722..461a75a 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.direct.expect
@@ -1,6 +1,36 @@
-library;
-import self as self;
+// Formatted problems:
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:35: Error: An equality expression can't be an operand of another equality expression.
+// Try re-writing the expression.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                   ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:36: Error: Expected an identifier, but got ')'.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                    ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:36: Warning: Getter not found: ''.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                    ^
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:35: Error: Unexpected token '>'.\nvar /*@topType=dynamic*/v = (f<int>)(() { return 1; });\n                                  ^";
-}
+// Unhandled errors:
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:35: Error: An equality expression can't be an operand of another equality expression.
+// Try re-writing the expression.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                   ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:36: Error: Expected an identifier, but got ')'.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                    ^
+
+library test;
+import self as self;
+import "dart:core" as core;
+
+static field dynamic v = self::f.<(core::int).>(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).call(() → dynamic {
+  return 1;
+});
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
+  return <self::f::T>[g.call()];
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.direct.transformed.expect
new file mode 100644
index 0000000..2af1d54
--- /dev/null
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.direct.transformed.expect
@@ -0,0 +1,21 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:35: Error: An equality expression can't be an operand of another equality expression.
+// Try re-writing the expression.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                   ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:36: Error: Expected an identifier, but got ')'.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                    ^
+
+library test;
+import self as self;
+import "dart:core" as core;
+
+static field dynamic v = self::f.<(core::int).>(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).call(() → dynamic {
+  return 1;
+});
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
+  return <self::f::T>[g.call()];
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.outline.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.outline.expect
new file mode 100644
index 0000000..88141c9
--- /dev/null
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.outline.expect
@@ -0,0 +1,24 @@
+// Formatted problems:
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:35: Error: An equality expression can't be an operand of another equality expression.
+// Try re-writing the expression.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                   ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:36: Error: Expected an identifier, but got ')'.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                    ^
+//
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:36: Warning: Getter not found: ''.
+// var /*@topType=dynamic*/v = (f<int>)(() { return 1; });
+//                                    ^
+
+library test;
+import self as self;
+import "dart:core" as core;
+
+static field dynamic v;
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
+  ;
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/outline.status b/pkg/front_end/testcases/outline.status
index 1159e1b..aeed5cf 100644
--- a/pkg/front_end/testcases/outline.status
+++ b/pkg/front_end/testcases/outline.status
@@ -87,7 +87,6 @@
 inference/generic_methods_infer_generic_function_return_type: Fail
 inference/generic_methods_infer_generic_instantiation: Fail
 inference/generic_methods_infer_generic_method_type: Fail
-inference/generic_methods_infer_js_builtin: Fail
 inference/generic_methods_inference_error: Fail
 inference/generic_methods_iterable_and_future: Fail
 inference/generic_methods_nested_generic_instantiation: Fail
@@ -226,10 +225,8 @@
 inference/unsafe_block_closure_inference_constructor_call_implicit_type_param: Fail
 inference/unsafe_block_closure_inference_constructor_call_no_type_param: Fail
 inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param: Fail
-inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1: Fail
 inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2: Fail
 inference/unsafe_block_closure_inference_function_call_explicit_type_param: Fail
-inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1: Fail
 inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2: Fail
 inference/unsafe_block_closure_inference_function_call_implicit_type_param: Fail
 inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr: Fail
diff --git a/pkg/front_end/testcases/regress/issue_29975.dart.outline.expect b/pkg/front_end/testcases/regress/issue_29975.dart.outline.expect
index 6573f56..5343ae7 100644
--- a/pkg/front_end/testcases/regress/issue_29975.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_29975.dart.outline.expect
@@ -11,6 +11,5 @@
 import self as self;
 
 typedef F = () → void;
-typedef F = () → void;
 static method main() → void
   ;
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart b/pkg/front_end/testcases/regress/issue_29976.dart
index 94e1cc1..3d2a10c 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart
+++ b/pkg/front_end/testcases/regress/issue_29976.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+get x => null;
+
 void main() {
   f(
     "x${x*"'"é'}x
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart.direct.expect b/pkg/front_end/testcases/regress/issue_29976.dart.direct.expect
index 8d5990c..b2fd9b3 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_29976.dart.direct.expect
@@ -1,70 +1,66 @@
 // Formatted problems:
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
 // Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:15: Error: String starting with ' must end with '.
 //     "x${x*"'"é'}x
 //               ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '${'.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:7: Error: Can't find '}' to match '${'.
 //     "x${x*"'"é'}x
 //       ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with " must end with ".
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: String starting with " must end with ".
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: Expected a declaration, but got ''.
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:9: Warning: Getter not found: 'x'.
-//     "x${x*"'"é'}x
-//         ^
-//
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: Expected '}' before this.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: Expected '}' before this.
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected a String, but got ')'.
 //   )
 //   ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:6:3: Warning: Method not found: 'f'.
+// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Warning: Method not found: 'f'.
 //   f(
 //   ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected ';' after this.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected ';' after this.
 //   )
 //   ^
 
 // Unhandled errors:
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
 // Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:15: Error: String starting with ' must end with '.
 //     "x${x*"'"é'}x
 //               ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '${'.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:7: Error: Can't find '}' to match '${'.
 //     "x${x*"'"é'}x
 //       ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with " must end with ".
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: String starting with " must end with ".
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: Expected a declaration, but got ''.
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: Expected '}' before this.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: Expected '}' before this.
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected a String, but got ')'.
 //   )
 //   ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected ';' after this.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected ';' after this.
 //   )
 //   ^
 
@@ -72,6 +68,8 @@
 import self as self;
 import "dart:core" as core;
 
+static get x() → dynamic
+  return null;
 static method main() → void {
-  throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#x, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+  throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${self::x.*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
 }
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_29976.dart.direct.transformed.expect
index 8d230f6..d89579f 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_29976.dart.direct.transformed.expect
@@ -1,31 +1,31 @@
 // Unhandled errors:
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
 // Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:15: Error: String starting with ' must end with '.
 //     "x${x*"'"é'}x
 //               ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '${'.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:7: Error: Can't find '}' to match '${'.
 //     "x${x*"'"é'}x
 //       ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with " must end with ".
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: String starting with " must end with ".
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: Expected a declaration, but got ''.
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: Expected '}' before this.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: Expected '}' before this.
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected a String, but got ')'.
 //   )
 //   ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected ';' after this.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected ';' after this.
 //   )
 //   ^
 
@@ -33,6 +33,8 @@
 import self as self;
 import "dart:core" as core;
 
+static get x() → dynamic
+  return null;
 static method main() → void {
-  throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#x, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+  throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${self::x.*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
 }
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart.outline.expect b/pkg/front_end/testcases/regress/issue_29976.dart.outline.expect
index 42d4c95..eb72274 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_29976.dart.outline.expect
@@ -1,24 +1,26 @@
 // Formatted problems:
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
 // Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:15: Error: String starting with ' must end with '.
 //     "x${x*"'"é'}x
 //               ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '${'.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:7: Error: Can't find '}' to match '${'.
 //     "x${x*"'"é'}x
 //       ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with " must end with ".
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: String starting with " must end with ".
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: Expected a declaration, but got ''.
 
 library;
 import self as self;
 
+static get x() → dynamic
+  ;
 static method main() → void
   ;
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart.strong.expect b/pkg/front_end/testcases/regress/issue_29976.dart.strong.expect
index a4e45941..381ef02 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_29976.dart.strong.expect
@@ -1,78 +1,70 @@
 // Formatted problems:
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
 // Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:15: Error: String starting with ' must end with '.
 //     "x${x*"'"é'}x
 //               ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '${'.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:7: Error: Can't find '}' to match '${'.
 //     "x${x*"'"é'}x
 //       ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with " must end with ".
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: String starting with " must end with ".
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: Expected a declaration, but got ''.
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:9: Error: Getter not found: 'x'.
-//     "x${x*"'"é'}x
-//         ^
-//
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: Expected '}' before this.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: Expected '}' before this.
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected a String, but got ')'.
 //   )
 //   ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:6:3: Error: Method not found: 'f'.
+// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Method not found: 'f'.
 //   f(
 //   ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected ';' after this.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected ';' after this.
 //   )
 //   ^
 
 // Unhandled errors:
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
 // Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:15: Error: String starting with ' must end with '.
 //     "x${x*"'"é'}x
 //               ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '${'.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:7: Error: Can't find '}' to match '${'.
 //     "x${x*"'"é'}x
 //       ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with " must end with ".
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: String starting with " must end with ".
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: Expected a declaration, but got ''.
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:7:9: Error: Getter not found: 'x'.
-//     "x${x*"'"é'}x
-//         ^
-//
-// pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: Expected '}' before this.
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: Expected '}' before this.
 //     "x${x*"'"é'}x
 //              ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected a String, but got ')'.
 //   )
 //   ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:6:3: Error: Method not found: 'f'.
+// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Method not found: 'f'.
 //   f(
 //   ^
 //
-// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected ';' after this.
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected ';' after this.
 //   )
 //   ^
 
@@ -80,6 +72,8 @@
 import self as self;
 import "dart:core" as core;
 
+static get x() → dynamic
+  return null;
 static method main() → void {
-  throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#x, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+  throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${self::x.*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
 }
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_29976.dart.strong.transformed.expect
index d2f376d..080428d 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_29976.dart.strong.transformed.expect
@@ -1,8 +1,44 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
+//     "x${x*"'"é'}x
+//              ^
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:9:15: Error: String starting with ' must end with '.
+//     "x${x*"'"é'}x
+//               ^
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:9:7: Error: Can't find '}' to match '${'.
+//     "x${x*"'"é'}x
+//       ^
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: String starting with " must end with ".
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:12:1: Error: Expected a declaration, but got ''.
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:9:14: Error: Expected '}' before this.
+//     "x${x*"'"é'}x
+//              ^
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected a String, but got ')'.
+//   )
+//   ^
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Method not found: 'f'.
+//   f(
+//   ^
+//
+// pkg/front_end/testcases/regress/issue_29976.dart:10:3: Error: Expected ';' after this.
+//   )
+//   ^
+
 library;
 import self as self;
+import "dart:core" as core;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
-  )
-  ^";
+static get x() → dynamic
+  return null;
+static method main() → void {
+  throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${self::x.*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
 }
diff --git a/pkg/front_end/testcases/regress/issue_29982.dart.direct.expect b/pkg/front_end/testcases/regress/issue_29982.dart.direct.expect
index f8f0cc4..2a74ae4 100644
--- a/pkg/front_end/testcases/regress/issue_29982.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_29982.dart.direct.expect
@@ -1,6 +1,74 @@
+// Formatted problems:
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
+//   print('${eh[éh']}');
+//               ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:14: Error: Can't find ']' to match '['.
+//   print('${eh[éh']}');
+//              ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:10: Error: Can't find '}' to match '${'.
+//   print('${eh[éh']}');
+//          ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: String starting with ' must end with '.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: Expected a declaration, but got ''.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected ']' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Warning: Getter not found: 'éh'.
+//   print('${eh[éh']}');
+//               ^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected '}' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:21: Error: Expected a String, but got ')'.
+//   print('${eh[éh']}');
+//                     ^
+
+// Unhandled errors:
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
+//   print('${eh[éh']}');
+//               ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:14: Error: Can't find ']' to match '['.
+//   print('${eh[éh']}');
+//              ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:10: Error: Can't find '}' to match '${'.
+//   print('${eh[éh']}');
+//          ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: String starting with ' must end with '.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: Expected a declaration, but got ''.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected ']' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected '}' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:21: Error: Expected a String, but got ')'.
+//   print('${eh[éh']}');
+//                     ^
+
 library;
 import self as self;
+import "dart:core" as core;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected ']' before this.\n  print('\${eh[\u0233h']}');\n                ^";
+static method main() → dynamic {
+  dynamic eh = <dynamic, dynamic>{"\u0233h": "\u0233h"};
+  core::print("${eh.[](throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#éh, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))))}");
 }
diff --git a/pkg/front_end/testcases/regress/issue_29982.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_29982.dart.direct.transformed.expect
new file mode 100644
index 0000000..e608ced
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_29982.dart.direct.transformed.expect
@@ -0,0 +1,39 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
+//   print('${eh[éh']}');
+//               ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:14: Error: Can't find ']' to match '['.
+//   print('${eh[éh']}');
+//              ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:10: Error: Can't find '}' to match '${'.
+//   print('${eh[éh']}');
+//          ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: String starting with ' must end with '.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: Expected a declaration, but got ''.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected ']' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected '}' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:21: Error: Expected a String, but got ')'.
+//   print('${eh[éh']}');
+//                     ^
+
+library;
+import self as self;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  dynamic eh = <dynamic, dynamic>{"\u0233h": "\u0233h"};
+  core::print("${eh.[](throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#éh, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))))}");
+}
diff --git a/pkg/front_end/testcases/regress/issue_29982.dart.strong.expect b/pkg/front_end/testcases/regress/issue_29982.dart.strong.expect
index f8f0cc4..3cf1dab 100644
--- a/pkg/front_end/testcases/regress/issue_29982.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_29982.dart.strong.expect
@@ -1,6 +1,78 @@
+// Formatted problems:
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
+//   print('${eh[éh']}');
+//               ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:14: Error: Can't find ']' to match '['.
+//   print('${eh[éh']}');
+//              ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:10: Error: Can't find '}' to match '${'.
+//   print('${eh[éh']}');
+//          ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: String starting with ' must end with '.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: Expected a declaration, but got ''.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected ']' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: Getter not found: 'éh'.
+//   print('${eh[éh']}');
+//               ^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected '}' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:21: Error: Expected a String, but got ')'.
+//   print('${eh[éh']}');
+//                     ^
+
+// Unhandled errors:
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
+//   print('${eh[éh']}');
+//               ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:14: Error: Can't find ']' to match '['.
+//   print('${eh[éh']}');
+//              ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:10: Error: Can't find '}' to match '${'.
+//   print('${eh[éh']}');
+//          ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: String starting with ' must end with '.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: Expected a declaration, but got ''.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected ']' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: Getter not found: 'éh'.
+//   print('${eh[éh']}');
+//               ^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected '}' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:21: Error: Expected a String, but got ')'.
+//   print('${eh[éh']}');
+//                     ^
+
 library;
 import self as self;
+import "dart:core" as core;
 
-static method #main() → dynamic {
-  throw "pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected ']' before this.\n  print('\${eh[\u0233h']}');\n                ^";
+static method main() → dynamic {
+  core::Map<core::String, core::String> eh = <core::String, core::String>{"\u0233h": "\u0233h"};
+  core::print("${eh.{core::Map::[]}(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#éh, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))))}");
 }
diff --git a/pkg/front_end/testcases/regress/issue_29982.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_29982.dart.strong.transformed.expect
new file mode 100644
index 0000000..02e6e5f
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_29982.dart.strong.transformed.expect
@@ -0,0 +1,43 @@
+// Unhandled errors:
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: The non-ASCII character 'é' (U+00E9) can't be used in identifiers, only in strings and comments.
+// Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).
+//   print('${eh[éh']}');
+//               ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:14: Error: Can't find ']' to match '['.
+//   print('${eh[éh']}');
+//              ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:10: Error: Can't find '}' to match '${'.
+//   print('${eh[éh']}');
+//          ^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: String starting with ' must end with '.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:9:1: Error: Expected a declaration, but got ''.
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected ']' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:15: Error: Getter not found: 'éh'.
+//   print('${eh[éh']}');
+//               ^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:17: Error: Expected '}' before this.
+//   print('${eh[éh']}');
+//                 ^^^^
+//
+// pkg/front_end/testcases/regress/issue_29982.dart:7:21: Error: Expected a String, but got ')'.
+//   print('${eh[éh']}');
+//                     ^
+
+library;
+import self as self;
+import "dart:core" as core;
+
+static method main() → dynamic {
+  core::Map<core::String, core::String> eh = <core::String, core::String>{"\u0233h": "\u0233h"};
+  core::print("${eh.{core::Map::[]}(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#éh, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))))}");
+}
diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status
index 5ff502b..70bdfe0 100644
--- a/pkg/front_end/testcases/strong.status
+++ b/pkg/front_end/testcases/strong.status
@@ -14,17 +14,17 @@
 await: Fail
 bug21938: TypeCheckError
 bug30695: TypeCheckError
-bug31124: RuntimeError # Test has an intentional error
+bug31124: RuntimeError # Test has no main method (and we shouldn't add one).
 bug32629: Fail # Test has an intentional error
 call: Fail
 cascade: Fail
 casts: Fail
 classes: Fail
 closure: Fail
-co19_language_metadata_syntax_t04: RuntimeError # Fasta doesn't recover well
 covariant_generic: Fail
 cycles: Fail
 default_values: Fail
+duplicated_declarations: TypeCheckError
 dynamic_and_void: Fail # Test assumes Dart 1.0 semantics
 escape: Fail
 external: Fail
@@ -184,8 +184,8 @@
 redirecting_factory_typeparam_test: Fail # Missing support for RedirectingFactoryConstructor.
 redirecting_factory_typeparambounds_test: Fail # Missing support for RedirectingFactoryConstructor.
 regress/issue_29975: Fail # Issue 29975.
-regress/issue_29976: TypeCheckError # Issue 29976.
-regress/issue_29982: Fail # Issue 29982.
+regress/issue_29976: RuntimeError # Tests runtime behavior of error recovery.
+regress/issue_29982: RuntimeError # Tests runtime behavior of error recovery.
 regress/issue_30836: RuntimeError # Issue 30836.
 regress/issue_31184: TypeCheckError
 regress/issue_31299: TypeCheckError