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

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

Issue 14050010: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
index eb2e8c03e60f20145765b2c1c25893643e24da58..d313bc5b930fcbaf1e82f94406463dd1e520f77b 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
@@ -1179,6 +1179,52 @@ public class SemanticTest extends AbstractSemanticTest {
getFormattedSource(unit));
}
+ public void test_giveUniqueName_methods_hierarchy_overloaded() throws Exception {
+ setFileLines(
+ "test/Test.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test {",
+ " <E> E void foo(E p) {",
+ " return null;",
+ " }",
+ "}",
+ ""));
+ setFileLines(
+ "test/Test2.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test2 extends Test {",
+ " int foo(int p) {",
+ " return 0;",
+ " }",
+ " void main() {",
+ " foo(this);",
+ " foo(42);",
+ " }",
+ "}",
+ ""));
+ Context context = new Context();
+ context.addSourceFolder(tmpFolder);
+ context.addSourceFiles(tmpFolder);
+ CompilationUnit unit = context.translate();
+ assertEquals(
+ toString(
+ "class Test {",
+ " void foo(Object p) => null;",
+ "}",
+ "class Test2 extends Test {",
+ " int foo2(int p) => 0;",
+ " void main() {",
+ " foo(this);",
+ " foo2(42);",
+ " }",
+ "}"),
+ getFormattedSource(unit));
+ }
+
public void test_giveUniqueName_variableInitializer() throws Exception {
File file = setFileLines(
"test/Test.java",
@@ -1685,7 +1731,7 @@ public class SemanticTest extends AbstractSemanticTest {
" }",
"}",
"class B extends A {",
- " void test() {",
+ " void test2() {",
" print(1);",
" super.test(2);",
" print(3);",

Powered by Google App Engine
This is Rietveld 408576698