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

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

Issue 18121002: Report PRIVATE_OPTIONAL_PARAMETER in more cases. (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 33635b792239a415fc0d4f2ab6d27224b94cd685..e8e820c0480c7873ba0b8ec6045286252223c4cd 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
@@ -2655,6 +2655,25 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
public void test_privateOptionalParameter() throws Exception {
Source source = addSource(createSource(//
+ "f({var _p}) {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER);
+ verify(source);
+ }
+
+ public void test_privateOptionalParameter_fieldFormal() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " var _p;",
+ " A({this._p: 0});",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER);
+ verify(source);
+ }
+
+ public void test_privateOptionalParameter_withDefaultValue() throws Exception {
+ Source source = addSource(createSource(//
"f({_p : 0}) {}"));
resolve(source);
assertErrors(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER);

Powered by Google App Engine
This is Rietveld 408576698