Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1871)

Unified Diff: dart/tests/language/list_literal_syntax_test.dart

Issue 10880026: Record literal list type arguments and report errors when there are too many. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated dart2dart status Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/tests/language/language.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/language/list_literal_syntax_test.dart
diff --git a/dart/tests/language/list_literal_syntax_test.dart b/dart/tests/language/list_literal_syntax_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5bd256f986e903c58ccdbe4e54a7b180dbf6412d
--- /dev/null
+++ b/dart/tests/language/list_literal_syntax_test.dart
@@ -0,0 +1,55 @@
+// Copyright (c) 2012, 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.
+
+interface I {}
+
+void main() {
+ var list;
+ list = <int
+ I /// 00: compile-time error
+ , int /// 01: compile-time error
+ >[0];
+ Expect.equals(1, list.length);
+
+ list = <int
+ , int /// 02: compile-time error
+ , int /// 02: continued
+ >[0];
+ Expect.equals(1, list.length);
+
+ list = <int
+ , int /// 03: compile-time error
+ , int /// 03: continued
+ , int /// 03: continued
+ >[0];
+ Expect.equals(1, list.length);
+
+ list =
+ <> /// 04: compile-time error
+ [0];
+ Expect.equals(1, list.length);
+
+ list =
+ <<>> /// 05: compile-time error
+ [0];
+ Expect.equals(1, list.length);
+
+ list =
+ <<<>>> /// 06: compile-time error
+ [0];
+ Expect.equals(1, list.length);
+
+ list =
+ <[]> /// 07: compile-time error
+ [0];
+ Expect.equals(1, list.length);
+
+ list = <int>[<int>[<int>[1][0]][0]];
+ Expect.equals(1, list.length);
+ Expect.equals(1, list[0]);
+
+ list = <int>[<List<int>>[[1]][0][0]];
+ Expect.equals(1, list.length);
+ Expect.equals(1, list[0]);
+}
« no previous file with comments | « dart/tests/language/language.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698