Chromium Code Reviews| Index: pkg/kernel/testcases/closures/arity.dart |
| diff --git a/pkg/kernel/testcases/closures/arity.dart b/pkg/kernel/testcases/closures/arity.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ed13ee6872a7f9b9e1f773c852ef7d596d373bf0 |
| --- /dev/null |
| +++ b/pkg/kernel/testcases/closures/arity.dart |
| @@ -0,0 +1,22 @@ |
| +// 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. |
|
Dmitry Stefantsov
2017/08/24 11:49:57
Please, add a description to this test case.
sjindel
2017/08/24 14:50:13
Done.
|
| +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!"); |
| + } |
| + } |
| +} |