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

Side by Side Diff: pkg/kernel/testcases/closures/arity.dart

Issue 3000333002: Fix several bugs in closure conversion. (Closed)
Patch Set: Comments. Created 3 years, 3 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 unified diff | Download patch
OLDNEW
(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.
4 //
5 // Test that closures check their argument count.
6 //
7 main() {
8 var closures = [
9 (x, y, [z]) {},
10 (x, y, z) {},
11 (x, y, {z}) {},
12 (x, y, z, w, v) {}
13 ];
14 for (var c in closures) {
15 bool ok = false;
16 try {
17 c(1, 2, 3, 4);
18 } on NoSuchMethodError catch (_) {
19 ok = true;
20 }
21 if (!ok) {
22 throw new Exception("Expected an error!");
23 }
24 }
25
26 (x, y, [z]) {}(1, 2);
27 (x, y, [z]) {}(1, 2, 3);
28 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/transformations/closure/invalidate_closures.dart ('k') | pkg/kernel/testcases/closures/arity.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698