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

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

Issue 9301007: Issue 561. Fix for methods named get/set/operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added shared test Created 8 years, 11 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 1987e6ddea792f32b9ea829ad21e96164ee56a7a..565c2e1ff2c90469acc341e31ce2ab97adc47a43 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
@@ -541,4 +541,40 @@ public class NegativeParserTest extends CompilerTestCase {
"}"),
parserRunner.getDartUnit().toSource());
}
+
+ /**
+ * "get" is valid name for method, it can cause warning, but not parsing failure.
+ */
+ public void test_methodNamed_get() {
+ parseExpectErrors(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " void get() {}",
+ "}",
+ ""));
+ }
+
+ /**
+ * "set" is valid name for method, it can cause warning, but not parsing failure.
+ */
+ public void test_methodNamed_set() {
+ parseExpectErrors(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " void set() {}",
+ "}",
+ ""));
+ }
+
+ /**
+ * "operator" is valid name for method, it can cause warning, but not parsing failure.
+ */
+ public void test_methodNamed_operator() {
+ parseExpectErrors(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " void operator() {}",
+ "}",
+ ""));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698