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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java

Issue 17574003: Report WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER for optional/named parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 6cd8bf7827b2cbec2839d989b11f1a7139a16340..b1ceb08e0eb54b7b4240bafce30e19cd3119b896 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -2833,6 +2833,20 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
check_wrongNumberOfParametersForOperator1("[]");
}
+ public void test_wrongNumberOfParametersForSetter_function_named() throws Exception {
+ Source source = addSource("set x({p}) {}");
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER);
+ verify(source);
+ }
+
+ public void test_wrongNumberOfParametersForSetter_function_optional() throws Exception {
+ Source source = addSource("set x([p]) {}");
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER);
+ verify(source);
+ }
+
public void test_wrongNumberOfParametersForSetter_function_tooFew() throws Exception {
Source source = addSource("set x() {}");
resolve(source);
@@ -2847,6 +2861,26 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_wrongNumberOfParametersForSetter_method_named() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " set x({p}) {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER);
+ verify(source);
+ }
+
+ public void test_wrongNumberOfParametersForSetter_method_optional() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " set x([p]) {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER);
+ verify(source);
+ }
+
public void test_wrongNumberOfParametersForSetter_method_tooFew() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698