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

Unified Diff: testcases/input/named_parameters.dart

Issue 2502343002: Store named parameters in sorted lists instead of using maps. (Closed)
Patch Set: Add testcase Created 4 years, 1 month 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
Index: testcases/input/named_parameters.dart
diff --git a/testcases/input/named_parameters.dart b/testcases/input/named_parameters.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b2a51eee97e85103e591cb2123cb8405f7228835
--- /dev/null
+++ b/testcases/input/named_parameters.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2016, 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.
+class Superclass {
+ foo({alpha, beta}) {}
+ bar({beta, alpha}) {}
+}
+
+class Subclass extends Superclass {
+ foo({beta, alpha}) {}
+ bar({alpha, beta}) {}
+}
+
+topLevelNamed(beta, alpha, {gamma, delta}) {}
+topLevelOptional(beta, alpha, [gamma, delta]) {}
+
+main() {
+ new Subclass().foo(beta: 1, alpha: 2);
+ new Subclass().foo(alpha: 1, beta: 2);
+ topLevelNamed(1, 2, gamma: 3, delta: 4);
+ topLevelNamed(1, 2, delta: 3, gamma: 4);
+}

Powered by Google App Engine
This is Rietveld 408576698