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

Unified Diff: compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java

Issue 10666020: Issue 2478. Support for 'factory lib.Interface.namedConstructor()' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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: compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
diff --git a/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java b/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
index 3f05faadfe9d17889841a8bfd91d53a1cf76bc68..aaddf2e5d61c88ba52345e3248b655a76a77b45c 100644
--- a/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
+++ b/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
@@ -750,13 +750,47 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
" }",
"}",
""));
- // do compile, no errors expected
+ // do compile, check errors
compile();
assertErrors(
errors,
errEx(ResolverErrorCode.CANNOT_ACCESS_METHOD, 6, 5, 7),
errEx(ResolverErrorCode.CANNOT_ACCESS_METHOD, 9, 11, 7));
}
+
+ /**
+ * When we resolve factory constructors, we should check if "lib" is library prefix, it is not
+ * always have to be name of type.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=2478
+ */
+ public void test_factoryClass_fromPrefixImportedLibrary() throws Exception {
+ appSource.setContent(
+ "A.dart",
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('A');",
+ "#import('" + APP + "');",
+ "interface I default A {",
+ " I();",
+ " I.named();",
+ "}",
+ ""));
+ appSource.setContent(
+ APP,
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('application');",
+ "#import('A.dart', prefix: 'lib');",
+ "class A {",
+ " factory lib.I() {}",
+ " factory lib.I.named() {}",
+ "}",
+ ""));
+ // do compile, no errors expected
+ compile();
+ assertErrors(errors);
+ }
/**
* <p>

Powered by Google App Engine
This is Rietveld 408576698