Add more spread collection fasta test cases

Change-Id: I998234da8f9e3f1e5902f8cd3fcad884c012f128
Reviewed-on: https://dart-review.googlesource.com/c/90080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
diff --git a/pkg/front_end/testcases/spread_collection.dart b/pkg/front_end/testcases/spread_collection.dart
index ede68fb..333331b 100644
--- a/pkg/front_end/testcases/spread_collection.dart
+++ b/pkg/front_end/testcases/spread_collection.dart
@@ -3,6 +3,14 @@
 // BSD-style license that can be found in the LICENSE file.
 
 main() {
-  final list = <int>[1, ...[2], ...?[3]];
-  print(list);
+  final aList = <int>[1, ...[2], ...?[3]];
+  final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+  final aSet = <int>{1, ...[2], ...?[3]};
+  final aSetOrMap = {...foo()};
+
+  print(aList);
+  print(aSet);
+  print(aMap);
 }
+
+foo() => null;
\ No newline at end of file
diff --git a/pkg/front_end/testcases/spread_collection.dart.legacy.expect b/pkg/front_end/testcases/spread_collection.dart.legacy.expect
index 2fa8e1a..e6445d9 100644
--- a/pkg/front_end/testcases/spread_collection.dart.legacy.expect
+++ b/pkg/front_end/testcases/spread_collection.dart.legacy.expect
@@ -2,18 +2,45 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/spread_collection.dart:6:25: Error: Unexpected token '...'.
-//   final list = <int>[1, ...[2], ...?[3]];
+// pkg/front_end/testcases/spread_collection.dart:6:26: Error: Unexpected token '...'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                          ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:6:34: Error: Unexpected token '...?'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                                  ^^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:7:33: Error: Unexpected token '...'.
+//   final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+//                                 ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:7:44: Error: Unexpected token '...?'.
+//   final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+//                                            ^^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:8:25: Error: Unexpected token '...'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                         ^^^
 //
-// pkg/front_end/testcases/spread_collection.dart:6:33: Error: Unexpected token '...?'.
-//   final list = <int>[1, ...[2], ...?[3]];
+// pkg/front_end/testcases/spread_collection.dart:8:33: Error: Unexpected token '...?'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                                 ^^^^
 //
+// pkg/front_end/testcases/spread_collection.dart:9:22: Error: Unexpected token '...'.
+//   final aSetOrMap = {...foo()};
+//                      ^^^
+//
 import self as self;
 import "dart:core" as core;
 
 static method main() → dynamic {
-  final dynamic list = <core::int>[1, <dynamic>[2], <dynamic>[3]];
-  core::print(list);
+  final dynamic aList = <core::int>[1, <dynamic>[2], <dynamic>[3]];
+  final dynamic aMap = <core::int, core::int>{1: 1};
+  final dynamic aSet = <core::int>{1, <dynamic>[2], <dynamic>[3]};
+  final dynamic aSetOrMap = <dynamic, dynamic>{};
+  core::print(aList);
+  core::print(aSet);
+  core::print(aMap);
 }
+static method foo() → dynamic
+  return null;
diff --git a/pkg/front_end/testcases/spread_collection.dart.legacy.transformed.expect b/pkg/front_end/testcases/spread_collection.dart.legacy.transformed.expect
index 2fa8e1a..e6445d9 100644
--- a/pkg/front_end/testcases/spread_collection.dart.legacy.transformed.expect
+++ b/pkg/front_end/testcases/spread_collection.dart.legacy.transformed.expect
@@ -2,18 +2,45 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/spread_collection.dart:6:25: Error: Unexpected token '...'.
-//   final list = <int>[1, ...[2], ...?[3]];
+// pkg/front_end/testcases/spread_collection.dart:6:26: Error: Unexpected token '...'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                          ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:6:34: Error: Unexpected token '...?'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                                  ^^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:7:33: Error: Unexpected token '...'.
+//   final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+//                                 ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:7:44: Error: Unexpected token '...?'.
+//   final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+//                                            ^^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:8:25: Error: Unexpected token '...'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                         ^^^
 //
-// pkg/front_end/testcases/spread_collection.dart:6:33: Error: Unexpected token '...?'.
-//   final list = <int>[1, ...[2], ...?[3]];
+// pkg/front_end/testcases/spread_collection.dart:8:33: Error: Unexpected token '...?'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                                 ^^^^
 //
+// pkg/front_end/testcases/spread_collection.dart:9:22: Error: Unexpected token '...'.
+//   final aSetOrMap = {...foo()};
+//                      ^^^
+//
 import self as self;
 import "dart:core" as core;
 
 static method main() → dynamic {
-  final dynamic list = <core::int>[1, <dynamic>[2], <dynamic>[3]];
-  core::print(list);
+  final dynamic aList = <core::int>[1, <dynamic>[2], <dynamic>[3]];
+  final dynamic aMap = <core::int, core::int>{1: 1};
+  final dynamic aSet = <core::int>{1, <dynamic>[2], <dynamic>[3]};
+  final dynamic aSetOrMap = <dynamic, dynamic>{};
+  core::print(aList);
+  core::print(aSet);
+  core::print(aMap);
 }
+static method foo() → dynamic
+  return null;
diff --git a/pkg/front_end/testcases/spread_collection.dart.outline.expect b/pkg/front_end/testcases/spread_collection.dart.outline.expect
index 6a28c0d..4c2eb20 100644
--- a/pkg/front_end/testcases/spread_collection.dart.outline.expect
+++ b/pkg/front_end/testcases/spread_collection.dart.outline.expect
@@ -3,3 +3,5 @@
 
 static method main() → dynamic
   ;
+static method foo() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/spread_collection.dart.strong.expect b/pkg/front_end/testcases/spread_collection.dart.strong.expect
index 37aeea3..8721adb 100644
--- a/pkg/front_end/testcases/spread_collection.dart.strong.expect
+++ b/pkg/front_end/testcases/spread_collection.dart.strong.expect
@@ -2,38 +2,86 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/spread_collection.dart:6:25: Error: Unexpected token '...'.
-//   final list = <int>[1, ...[2], ...?[3]];
+// pkg/front_end/testcases/spread_collection.dart:6:26: Error: Unexpected token '...'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                          ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:6:34: Error: Unexpected token '...?'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                                  ^^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:7:33: Error: Unexpected token '...'.
+//   final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+//                                 ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:7:44: Error: Unexpected token '...?'.
+//   final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+//                                            ^^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:8:25: Error: Unexpected token '...'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                         ^^^
 //
-// pkg/front_end/testcases/spread_collection.dart:6:33: Error: Unexpected token '...?'.
-//   final list = <int>[1, ...[2], ...?[3]];
+// pkg/front_end/testcases/spread_collection.dart:8:33: Error: Unexpected token '...?'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                                 ^^^^
 //
-// pkg/front_end/testcases/spread_collection.dart:6:28: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+// pkg/front_end/testcases/spread_collection.dart:9:22: Error: Unexpected token '...'.
+//   final aSetOrMap = {...foo()};
+//                      ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:6:29: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
 //  - 'List' is from 'dart:core'.
 // Try changing the type of the left hand side, or casting the right hand side to 'int'.
-//   final list = <int>[1, ...[2], ...?[3]];
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                             ^
+//
+// pkg/front_end/testcases/spread_collection.dart:6:38: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+//  - 'List' is from 'dart:core'.
+// Try changing the type of the left hand side, or casting the right hand side to 'int'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                                      ^
+//
+// pkg/front_end/testcases/spread_collection.dart:8:28: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+//  - 'List' is from 'dart:core'.
+// Try changing the type of the left hand side, or casting the right hand side to 'int'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                            ^
 //
-// pkg/front_end/testcases/spread_collection.dart:6:37: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+// pkg/front_end/testcases/spread_collection.dart:8:37: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
 //  - 'List' is from 'dart:core'.
 // Try changing the type of the left hand side, or casting the right hand side to 'int'.
-//   final list = <int>[1, ...[2], ...?[3]];
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                                     ^
 //
 import self as self;
 import "dart:core" as core;
+import "dart:collection" as col;
 
 static method main() → dynamic {
-  final core::List<core::int> list = <core::int>[1, let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:6:28: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+  final core::List<core::int> aList = <core::int>[1, let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:6:29: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
  - 'List' is from 'dart:core'.
 Try changing the type of the left hand side, or casting the right hand side to 'int'.
-  final list = <int>[1, ...[2], ...?[3]];
-                           ^" in <core::int>[2] as{TypeError} core::int, let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:6:37: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+  final aList = <int>[1, ...[2], ...?[3]];
+                            ^" in <core::int>[2] as{TypeError} core::int, let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:6:38: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
  - 'List' is from 'dart:core'.
 Try changing the type of the left hand side, or casting the right hand side to 'int'.
-  final list = <int>[1, ...[2], ...?[3]];
-                                    ^" in <core::int>[3] as{TypeError} core::int];
-  core::print(list);
+  final aList = <int>[1, ...[2], ...?[3]];
+                                     ^" in <core::int>[3] as{TypeError} core::int];
+  final core::Map<core::int, core::int> aMap = <core::int, core::int>{1: 1};
+  final core::Set<core::int> aSet = let final core::Set<core::int> #t3 = col::LinkedHashSet::•<core::int>() in let final dynamic #t4 = #t3.{core::Set::add}(1) in let final dynamic #t5 = #t3.{core::Set::add}(let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:8:28: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+ - 'List' is from 'dart:core'.
+Try changing the type of the left hand side, or casting the right hand side to 'int'.
+  final aSet = <int>{1, ...[2], ...?[3]};
+                           ^" in <core::int>[2] as{TypeError} core::int) in let final dynamic #t7 = #t3.{core::Set::add}(let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:8:37: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+ - 'List' is from 'dart:core'.
+Try changing the type of the left hand side, or casting the right hand side to 'int'.
+  final aSet = <int>{1, ...[2], ...?[3]};
+                                    ^" in <core::int>[3] as{TypeError} core::int) in #t3;
+  final core::Map<dynamic, dynamic> aSetOrMap = <dynamic, dynamic>{};
+  core::print(aList);
+  core::print(aSet);
+  core::print(aMap);
 }
+static method foo() → dynamic
+  return null;
diff --git a/pkg/front_end/testcases/spread_collection.dart.strong.transformed.expect b/pkg/front_end/testcases/spread_collection.dart.strong.transformed.expect
index 37aeea3..6ee5ecf 100644
--- a/pkg/front_end/testcases/spread_collection.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/spread_collection.dart.strong.transformed.expect
@@ -2,38 +2,86 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/spread_collection.dart:6:25: Error: Unexpected token '...'.
-//   final list = <int>[1, ...[2], ...?[3]];
+// pkg/front_end/testcases/spread_collection.dart:6:26: Error: Unexpected token '...'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                          ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:6:34: Error: Unexpected token '...?'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                                  ^^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:7:33: Error: Unexpected token '...'.
+//   final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+//                                 ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:7:44: Error: Unexpected token '...?'.
+//   final aMap = <int, int>{1: 1, ...{2: 2}, ...?{3: 3}};
+//                                            ^^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:8:25: Error: Unexpected token '...'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                         ^^^
 //
-// pkg/front_end/testcases/spread_collection.dart:6:33: Error: Unexpected token '...?'.
-//   final list = <int>[1, ...[2], ...?[3]];
+// pkg/front_end/testcases/spread_collection.dart:8:33: Error: Unexpected token '...?'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                                 ^^^^
 //
-// pkg/front_end/testcases/spread_collection.dart:6:28: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+// pkg/front_end/testcases/spread_collection.dart:9:22: Error: Unexpected token '...'.
+//   final aSetOrMap = {...foo()};
+//                      ^^^
+//
+// pkg/front_end/testcases/spread_collection.dart:6:29: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
 //  - 'List' is from 'dart:core'.
 // Try changing the type of the left hand side, or casting the right hand side to 'int'.
-//   final list = <int>[1, ...[2], ...?[3]];
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                             ^
+//
+// pkg/front_end/testcases/spread_collection.dart:6:38: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+//  - 'List' is from 'dart:core'.
+// Try changing the type of the left hand side, or casting the right hand side to 'int'.
+//   final aList = <int>[1, ...[2], ...?[3]];
+//                                      ^
+//
+// pkg/front_end/testcases/spread_collection.dart:8:28: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+//  - 'List' is from 'dart:core'.
+// Try changing the type of the left hand side, or casting the right hand side to 'int'.
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                            ^
 //
-// pkg/front_end/testcases/spread_collection.dart:6:37: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+// pkg/front_end/testcases/spread_collection.dart:8:37: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
 //  - 'List' is from 'dart:core'.
 // Try changing the type of the left hand side, or casting the right hand side to 'int'.
-//   final list = <int>[1, ...[2], ...?[3]];
+//   final aSet = <int>{1, ...[2], ...?[3]};
 //                                     ^
 //
 import self as self;
 import "dart:core" as core;
+import "dart:collection" as col;
 
 static method main() → dynamic {
-  final core::List<core::int> list = <core::int>[1, let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:6:28: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+  final core::List<core::int> aList = <core::int>[1, let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:6:29: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
  - 'List' is from 'dart:core'.
 Try changing the type of the left hand side, or casting the right hand side to 'int'.
-  final list = <int>[1, ...[2], ...?[3]];
-                           ^" in <core::int>[2] as{TypeError} core::int, let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:6:37: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+  final aList = <int>[1, ...[2], ...?[3]];
+                            ^" in <core::int>[2] as{TypeError} core::int, let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:6:38: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
  - 'List' is from 'dart:core'.
 Try changing the type of the left hand side, or casting the right hand side to 'int'.
-  final list = <int>[1, ...[2], ...?[3]];
-                                    ^" in <core::int>[3] as{TypeError} core::int];
-  core::print(list);
+  final aList = <int>[1, ...[2], ...?[3]];
+                                     ^" in <core::int>[3] as{TypeError} core::int];
+  final core::Map<core::int, core::int> aMap = <core::int, core::int>{1: 1};
+  final core::Set<core::int> aSet = let final core::Set<core::int> #t3 = col::LinkedHashSet::•<core::int>() in let final core::bool #t4 = #t3.{core::Set::add}(1) in let final core::bool #t5 = #t3.{core::Set::add}(let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:8:28: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+ - 'List' is from 'dart:core'.
+Try changing the type of the left hand side, or casting the right hand side to 'int'.
+  final aSet = <int>{1, ...[2], ...?[3]};
+                           ^" in <core::int>[2] as{TypeError} core::int) in let final core::bool #t7 = #t3.{core::Set::add}(let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/spread_collection.dart:8:37: Error: A value of type 'List<int>' can't be assigned to a variable of type 'int'.
+ - 'List' is from 'dart:core'.
+Try changing the type of the left hand side, or casting the right hand side to 'int'.
+  final aSet = <int>{1, ...[2], ...?[3]};
+                                    ^" in <core::int>[3] as{TypeError} core::int) in #t3;
+  final core::Map<dynamic, dynamic> aSetOrMap = <dynamic, dynamic>{};
+  core::print(aList);
+  core::print(aSet);
+  core::print(aMap);
 }
+static method foo() → dynamic
+  return null;