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

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

Issue 10538077: Issue 3340. conflict of a library prefix and a name in the importing library should produce a compi… (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 7a6148519945f0499d8247abda03bc4bb0f84382..a27ba5747a3d0279b8ce29898484419d07fc0a32 100644
--- a/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
+++ b/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
@@ -734,6 +734,32 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
errEx(ResolverErrorCode.CANNOT_ACCESS_METHOD, 6, 5, 9),
errEx(ResolverErrorCode.CANNOT_ACCESS_METHOD, 9, 5, 15));
}
+
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=3340
+ */
+ public void test_useImportPrefix_asVariableName() throws Exception {
+ appSource.setContent(
+ "A.dart",
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('A');",
+ ""));
+ appSource.setContent(
+ APP,
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('application');",
+ "#import('A.dart', prefix: 'prf');",
+ "main() {",
+ " var prf;",
+ "}",
+ ""));
+ // do compile, no errors expected
+ compile();
+ assertErrors(errors, errEx(ResolverErrorCode.CANNOT_HIDE_IMPORT_PREFIX, 5, 7, 3));
+ }
private void assertAppBuilt() {
didWrite(APP, EXTENSION_DEPS);
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698