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

Unified Diff: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java

Issue 12208101: Getter and setter methods can share name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« no previous file with comments | « editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java
index c3a90464aa8d9d2a73d4434edfdafc39596b6c73..2fcf8b27b6e09f1dcd934579bfbd9c795fbfd747 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java
@@ -97,6 +97,35 @@ public class PropertySemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_makeProperty_shareGetSetNames() throws Exception {
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test {",
+ " public int getFoo() {",
+ " return 0;",
+ " }",
+ " public void setFoo(int v) {",
+ " }",
+ " public void main() {",
+ " setFoo(1);",
+ " print(getFoo());",
+ " }",
+ "}");
+ PropertySemanticProcessor.INSTANCE.process(context, unit);
+ context.ensureUniqueClassMemberNames(unit);
+ assertFormattedSource(
+ "class Test {",
+ " int get foo => 0;",
+ " void set foo(int v) {",
+ " }",
+ " void main() {",
+ " foo = 1;",
+ " print(foo);",
+ " }",
+ "}");
+ }
+
public void test_renamePrivateFields() throws Exception {
translateSingleFile(
"// filler filler filler filler filler filler filler filler filler filler",
« no previous file with comments | « editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698