OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // 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.
| |
4 main() { | |
5 var closures = [ | |
6 (x, y, [z]) {}, | |
7 (x, y, z) {}, | |
8 (x, y, {z}) {}, | |
9 (x, y, z, w, v) {} | |
10 ]; | |
11 for (var c in closures) { | |
12 bool ok = false; | |
13 try { | |
14 c(1, 2, 3, 4); | |
15 } on NoSuchMethodError catch (_) { | |
16 ok = true; | |
17 } | |
18 if (!ok) { | |
19 throw new Exception("Expected an error!"); | |
20 } | |
21 } | |
22 } | |
OLD | NEW |