From d0f20624930e529f327ebc83cf2c042056cabb7f Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 13 Aug 2010 16:21:44 +0000 Subject: closes #3663. namers wasn't setting privateWithin on java-defined variables (btw, ) shouldn't clone carry over privateWithin? better treatment of linked ) class access boundary (only check for access within linked class if it ) actually exists ) would have liked more control for the test case: only javac should compile the java file, then scalac should compile the scala file and fail review by odersky --- test/files/neg/t3663.check | 4 ++++ test/files/neg/t3663/PackageProtected.java | 5 +++++ test/files/neg/t3663/main.scala | 14 ++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 test/files/neg/t3663.check create mode 100644 test/files/neg/t3663/PackageProtected.java create mode 100644 test/files/neg/t3663/main.scala (limited to 'test/files') diff --git a/test/files/neg/t3663.check b/test/files/neg/t3663.check new file mode 100644 index 0000000000..09ea25ad91 --- /dev/null +++ b/test/files/neg/t3663.check @@ -0,0 +1,4 @@ +main.scala:11: error: variable foo cannot be accessed in test.Test + println(t.foo) + ^ +one error found diff --git a/test/files/neg/t3663/PackageProtected.java b/test/files/neg/t3663/PackageProtected.java new file mode 100644 index 0000000000..f4535a55b4 --- /dev/null +++ b/test/files/neg/t3663/PackageProtected.java @@ -0,0 +1,5 @@ +package test; + +class PackageProtected { + int foo; +} diff --git a/test/files/neg/t3663/main.scala b/test/files/neg/t3663/main.scala new file mode 100644 index 0000000000..29619550cc --- /dev/null +++ b/test/files/neg/t3663/main.scala @@ -0,0 +1,14 @@ +package test + +final class Test extends PackageProtected { + def bar = foo +} + +package another { + object Main { + def bug(t: Test) { + // Can always be replicated. + println(t.foo) + } + } +} \ No newline at end of file -- cgit v1.2.3