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

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

Issue 10537006: Issue 3266. Produce a warning when trying to call an inaccessible method (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
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a9b7f4cefab6cf5f2dd4e2425092cd57660f09f5..7a6148519945f0499d8247abda03bc4bb0f84382 100644
--- a/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
+++ b/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
@@ -698,6 +698,43 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
compile();
}
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=3266
+ */
+ public void test_inaccessibleMethod_fromOtherLibrary() throws Exception {
+ appSource.setContent(
+ "A.dart",
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('A');",
+ "class A {",
+ " _method() {}",
+ "}",
+ ""));
+ appSource.setContent(
+ APP,
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('application');",
+ "#import('A.dart');",
+ "class B extends A {",
+ " test1() {",
+ " _method();",
+ " }",
+ " test2() {",
+ " super._method();",
+ " }",
+ "}",
+ ""));
+ // do compile, no errors expected
+ compile();
+ assertErrors(
+ errors,
+ errEx(ResolverErrorCode.CANNOT_ACCESS_METHOD, 6, 5, 9),
+ errEx(ResolverErrorCode.CANNOT_ACCESS_METHOD, 9, 5, 15));
+ }
+
private void assertAppBuilt() {
didWrite(APP, EXTENSION_DEPS);
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698