add regression test for issue 37285

Change-Id: Ieb2636ba8404c95a6b3027bd5fccf02876940933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106501
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
diff --git a/pkg/front_end/testcases/legacy.status b/pkg/front_end/testcases/legacy.status
index e98216b..7498cec 100644
--- a/pkg/front_end/testcases/legacy.status
+++ b/pkg/front_end/testcases/legacy.status
@@ -119,6 +119,7 @@
 regress/issue_36647: RuntimeError # Expected
 regress/issue_36647_2: RuntimeError # Expected
 regress/issue_36669: RuntimeError
+regress/issue_37285: RuntimeError
 reject_generic_function_types_in_bounds: RuntimeError # Expected
 runtime_checks/implicit_downcast_constructor_initializer: RuntimeError # Test exercises strong mode semantics
 runtime_checks/implicit_downcast_do: RuntimeError # Test exercises strong mode semantics
diff --git a/pkg/front_end/testcases/regress/issue_37285.dart b/pkg/front_end/testcases/regress/issue_37285.dart
new file mode 100644
index 0000000..6b5857d
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_37285.dart
@@ -0,0 +1,12 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class C {
+  C() : super()[];
+}
+
+main () {
+  new C();
+}
+
diff --git a/pkg/front_end/testcases/regress/issue_37285.dart.hierarchy.expect b/pkg/front_end/testcases/regress/issue_37285.dart.hierarchy.expect
new file mode 100644
index 0000000..ba00015
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_37285.dart.hierarchy.expect
@@ -0,0 +1,36 @@
+Object:
+  superclasses:
+  interfaces:
+  classMembers:
+    Object._haveSameRuntimeType
+    Object.toString
+    Object.runtimeType
+    Object._toString
+    Object._simpleInstanceOf
+    Object._hashCodeRnd
+    Object._instanceOf
+    Object.noSuchMethod
+    Object._objectHashCode
+    Object._identityHashCode
+    Object.hashCode
+    Object._simpleInstanceOfFalse
+    Object._simpleInstanceOfTrue
+    Object.==
+  classSetters:
+
+C:
+  superclasses:
+    Object
+  interfaces:
+  classMembers:
+    Object.toString
+    Object.runtimeType
+    Object._simpleInstanceOf
+    Object._instanceOf
+    Object.noSuchMethod
+    Object._identityHashCode
+    Object.hashCode
+    Object._simpleInstanceOfFalse
+    Object._simpleInstanceOfTrue
+    Object.==
+  classSetters:
diff --git a/pkg/front_end/testcases/regress/issue_37285.dart.legacy.expect b/pkg/front_end/testcases/regress/issue_37285.dart.legacy.expect
new file mode 100644
index 0000000..f7de288
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_37285.dart.legacy.expect
@@ -0,0 +1,32 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:17: Error: Expected an identifier, but got ']'.
+//   C() : super()[];
+//                 ^
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:9: Error: Can't use 'super' as an expression.
+// To delegate a constructor to a super constructor, put the super call as an initializer.
+//   C() : super()[];
+//         ^
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:16: Error: Not a valid initializer.
+// To initialize a field, use the syntax 'name = value'.
+//   C() : super()[];
+//                ^
+//
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+  constructor •() → self::C
+    : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/regress/issue_37285.dart:6:16: Error: Not a valid initializer.
+To initialize a field, use the syntax 'name = value'.
+  C() : super()[];
+               ^"
+    ;
+}
+static method main() → dynamic {
+  new self::C::•();
+}
diff --git a/pkg/front_end/testcases/regress/issue_37285.dart.legacy.transformed.expect b/pkg/front_end/testcases/regress/issue_37285.dart.legacy.transformed.expect
new file mode 100644
index 0000000..f7de288
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_37285.dart.legacy.transformed.expect
@@ -0,0 +1,32 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:17: Error: Expected an identifier, but got ']'.
+//   C() : super()[];
+//                 ^
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:9: Error: Can't use 'super' as an expression.
+// To delegate a constructor to a super constructor, put the super call as an initializer.
+//   C() : super()[];
+//         ^
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:16: Error: Not a valid initializer.
+// To initialize a field, use the syntax 'name = value'.
+//   C() : super()[];
+//                ^
+//
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+  constructor •() → self::C
+    : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/regress/issue_37285.dart:6:16: Error: Not a valid initializer.
+To initialize a field, use the syntax 'name = value'.
+  C() : super()[];
+               ^"
+    ;
+}
+static method main() → dynamic {
+  new self::C::•();
+}
diff --git a/pkg/front_end/testcases/regress/issue_37285.dart.outline.expect b/pkg/front_end/testcases/regress/issue_37285.dart.outline.expect
new file mode 100644
index 0000000..2437d0c
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_37285.dart.outline.expect
@@ -0,0 +1,17 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:17: Error: Expected an identifier, but got ']'.
+//   C() : super()[];
+//                 ^
+//
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+  constructor •() → self::C
+    ;
+}
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/regress/issue_37285.dart.strong.expect b/pkg/front_end/testcases/regress/issue_37285.dart.strong.expect
new file mode 100644
index 0000000..f7de288
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_37285.dart.strong.expect
@@ -0,0 +1,32 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:17: Error: Expected an identifier, but got ']'.
+//   C() : super()[];
+//                 ^
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:9: Error: Can't use 'super' as an expression.
+// To delegate a constructor to a super constructor, put the super call as an initializer.
+//   C() : super()[];
+//         ^
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:16: Error: Not a valid initializer.
+// To initialize a field, use the syntax 'name = value'.
+//   C() : super()[];
+//                ^
+//
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+  constructor •() → self::C
+    : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/regress/issue_37285.dart:6:16: Error: Not a valid initializer.
+To initialize a field, use the syntax 'name = value'.
+  C() : super()[];
+               ^"
+    ;
+}
+static method main() → dynamic {
+  new self::C::•();
+}
diff --git a/pkg/front_end/testcases/regress/issue_37285.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_37285.dart.strong.transformed.expect
new file mode 100644
index 0000000..f7de288
--- /dev/null
+++ b/pkg/front_end/testcases/regress/issue_37285.dart.strong.transformed.expect
@@ -0,0 +1,32 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:17: Error: Expected an identifier, but got ']'.
+//   C() : super()[];
+//                 ^
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:9: Error: Can't use 'super' as an expression.
+// To delegate a constructor to a super constructor, put the super call as an initializer.
+//   C() : super()[];
+//         ^
+//
+// pkg/front_end/testcases/regress/issue_37285.dart:6:16: Error: Not a valid initializer.
+// To initialize a field, use the syntax 'name = value'.
+//   C() : super()[];
+//                ^
+//
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+  constructor •() → self::C
+    : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/regress/issue_37285.dart:6:16: Error: Not a valid initializer.
+To initialize a field, use the syntax 'name = value'.
+  C() : super()[];
+               ^"
+    ;
+}
+static method main() → dynamic {
+  new self::C::•();
+}
diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status
index 58b6314..b6b06a7 100644
--- a/pkg/front_end/testcases/strong.status
+++ b/pkg/front_end/testcases/strong.status
@@ -147,6 +147,7 @@
 regress/issue_36647: RuntimeError # Expected
 regress/issue_36647_2: RuntimeError # Expected
 regress/issue_36669: RuntimeError
+regress/issue_37285: RuntimeError
 reject_generic_function_types_in_bounds: RuntimeError # Expected
 runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast: RuntimeError
 runtime_checks_new/mixin_forwarding_stub_field: TypeCheckError
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
index da910da..870688e 100644
--- a/pkg/front_end/testcases/text_serialization.status
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -933,6 +933,7 @@
 regress/issue_36647_2: TextSerializationFailure
 regress/issue_36669: TextSerializationFailure
 regress/issue_36793: TextSerializationFailure
+regress/issue_37285: TextSerializationFailure
 reject_generic_function_types_in_bounds: TextSerializationFailure # Was: RuntimeError # Expected
 return_with_unknown_type_in_context: TextSerializationFailure # Was: Pass
 runtime_checks/call_kinds: TextSerializationFailure # Was: Pass