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

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java

Issue 11309011: Issue 4289. Separate optional positional and named parameters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
index f6273143681e30b7317385b46d8fa54503b49bd7..82527ec99cd0e5dfcaeabe2e54698e4412d6d221 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
@@ -175,9 +175,15 @@ public class NegativeParserTest extends CompilerTestCase {
errEx(ParserErrorCode.DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_CLOSURE, 1, 41, 5));
}
- public void test_namedParameterValue_inSetter() {
+ public void test_optionalPositionalParameterValue_inSetter() {
parseExpectErrors(
"class A { set f([int b]); }",
+ errEx(ParserErrorCode.OPTIONAL_POSITIONAL_PARAMETER_NOT_ALLOWED, 1, 18, 5));
+ }
+
+ public void test_namedParameterValue_inSetter() {
+ parseExpectErrors(
+ "class A { set f({int b}); }",
errEx(ParserErrorCode.NAMED_PARAMETER_NOT_ALLOWED, 1, 18, 5));
}
@@ -187,9 +193,15 @@ public class NegativeParserTest extends CompilerTestCase {
errEx(ParserErrorCode.MISSING_OPTIONAL_PARAMETER_END, 1, 43, 1));
}
- public void test_namedParameterValue_inOperator() {
+ public void test_optionalPositionalParameterValue_inOperator() {
parseExpectErrors(
"class A { operator []=(int a, [int b]); }",
+ errEx(ParserErrorCode.OPTIONAL_POSITIONAL_PARAMETER_NOT_ALLOWED, 1, 32, 5));
+ }
+
+ public void test_namedParameterValue_inOperator() {
+ parseExpectErrors(
+ "class A { operator []=(int a, {int b}); }",
errEx(ParserErrorCode.NAMED_PARAMETER_NOT_ALLOWED, 1, 32, 5));
}

Powered by Google App Engine
This is Rietveld 408576698