diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/inlineAccess/C_1.scala | 8 | ||||
-rw-r--r-- | tests/neg/inlineAccess/Test_2.scala | 7 |
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() + } +} |