mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 16:13:19 +00:00
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>
This commit is contained in:
parent
6639cbd6c3
commit
ddce2824fa
|
@ -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;
|
|
@ -2,18 +2,45 @@ library;
|
|||
//
|
||||
// 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;
|
||||
|
|
|
@ -2,18 +2,45 @@ library;
|
|||
//
|
||||
// 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;
|
||||
|
|
|
@ -3,3 +3,5 @@ import self as self;
|
|||
|
||||
static method main() → dynamic
|
||||
;
|
||||
static method foo() → dynamic
|
||||
;
|
||||
|
|
|
@ -2,38 +2,86 @@ library;
|
|||
//
|
||||
// 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;
|
||||
|
|
|
@ -2,38 +2,86 @@ library;
|
|||
//
|
||||
// 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;
|
||||
|
|
Loading…
Reference in a new issue