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

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

Issue 10829064: Issue 4072. Generate warning when private instance method is called (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/type/TypeAnalyzer.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 cfe3eba98a8cb2e20e24ac7ce75ea88ddfb7c57b..277d42ac37cf8a8f2beefbb861cf08cef602f17a 100644
--- a/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
+++ b/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
@@ -723,9 +723,72 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
/**
* <p>
+ * http://code.google.com/p/dart/issues/detail?id=4072
+ */
+ public void test_inaccessibleMethod_fromOtherLibrary_static() throws Exception {
+ appSource.setContent(
+ "A.dart",
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('A');",
+ "class A {",
+ " static _privateStatic() {}",
+ "}",
+ ""));
+ appSource.setContent(
+ APP,
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('application');",
+ "#import('A.dart');",
+ "main() {",
+ " A._privateStatic();",
+ "}",
+ ""));
+ // do compile, check errors
+ compile();
+ assertErrors(
+ errors,
+ errEx(ResolverErrorCode.ILLEGAL_ACCESS_TO_PRIVATE, 5, 5, 14));
+ }
+
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=4072
+ */
+ public void test_inaccessibleMethod_fromOtherLibrary_instance() throws Exception {
+ appSource.setContent(
+ "A.dart",
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('A');",
+ "class A {",
+ " _privateInstance() {}",
+ "}",
+ ""));
+ appSource.setContent(
+ APP,
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "#library('application');",
+ "#import('A.dart');",
+ "main() {",
+ " A a = new A();",
+ " a._privateInstance();",
+ "}",
+ ""));
+ // do compile, check errors
+ compile();
+ assertErrors(
+ errors,
+ errEx(TypeErrorCode.ILLEGAL_ACCESS_TO_PRIVATE, 6, 5, 16));
+ }
+
+ /**
+ * <p>
* http://code.google.com/p/dart/issues/detail?id=3266
*/
- public void test_inaccessibleMethod_fromOtherLibrary() throws Exception {
+ public void test_inaccessibleSuperMethod_fromOtherLibrary() throws Exception {
appSource.setContent(
"A.dart",
makeCode(
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698