Index: pkg/kernel/testcases/arity.dart |
diff --git a/pkg/kernel/testcases/arity.dart b/pkg/kernel/testcases/arity.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d836197125d03d51a9b7d97c0528b2bcb79d7926 |
--- /dev/null |
+++ b/pkg/kernel/testcases/arity.dart |
@@ -0,0 +1,24 @@ |
+/* |
Dmitry Stefantsov
2017/08/24 09:41:13
Please, use line comments for the preamble here an
Dmitry Stefantsov
2017/08/24 09:41:13
I think this file belongs to `pkg/kernel/testcases
sjindel
2017/08/24 11:11:43
I think I just copied it from another file (maybe
|
+ * Copyright (c) 2017, 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. |
+ */ |
+main() { |
+ var closures = [ |
+ (x, y, [z]) {}, |
+ (x, y, z) {}, |
+ (x, y, {z}) {}, |
+ (x, y, z, w, v) {} |
+ ]; |
+ for (var c in closures) { |
+ bool ok = false; |
+ try { |
+ c(1, 2, 3, 4); |
+ } on NoSuchMethodError catch (_) { |
+ ok = true; |
+ } |
+ if (!ok) { |
+ throw new Exception("Expected an error!"); |
+ } |
+ } |
+} |