aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/inlineAccess
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-04 15:10:44 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:11:21 +0200
commitc1674dc461ee3f4bf38b7b895cfc9d7d6b41b53f (patch)
tree7b1340917b86e09df1187d422771e07e9c19f8bf /tests/neg/inlineAccess
parent333ec27c9e503f428c86a155351d11f332f2892d (diff)
downloaddotty-c1674dc461ee3f4bf38b7b895cfc9d7d6b41b53f.tar.gz
dotty-c1674dc461ee3f4bf38b7b895cfc9d7d6b41b53f.tar.bz2
dotty-c1674dc461ee3f4bf38b7b895cfc9d7d6b41b53f.zip
Neg test demonstrating inline positions under cross-compilation
Diffstat (limited to 'tests/neg/inlineAccess')
-rw-r--r--tests/neg/inlineAccess/C_1.scala8
-rw-r--r--tests/neg/inlineAccess/Test_2.scala7
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/neg/inlineAccess/C_1.scala b/tests/neg/inlineAccess/C_1.scala
new file mode 100644
index 000000000..fc24f7666
--- /dev/null
+++ b/tests/neg/inlineAccess/C_1.scala
@@ -0,0 +1,8 @@
+package p {
+class C {
+ protected def f(): Unit = ()
+
+ @dotty.annotation.inline
+ def inl() = f() // error (when inlined): not accessible
+}
+}
diff --git a/tests/neg/inlineAccess/Test_2.scala b/tests/neg/inlineAccess/Test_2.scala
new file mode 100644
index 000000000..98ea7693a
--- /dev/null
+++ b/tests/neg/inlineAccess/Test_2.scala
@@ -0,0 +1,7 @@
+
+object Test {
+ def main(args: Array[String]) = {
+ val c = new p.C()
+ c.inl()
+ }
+}