diff --git a/tests/neg/i8194.check b/tests/neg/i8194.check new file mode 100644 index 000000000000..58b163b142f5 --- /dev/null +++ b/tests/neg/i8194.check @@ -0,0 +1,12 @@ +-- [E173] Reference Error: tests/neg/i8194.scala:5:22 ------------------------------------------------------------------ +5 |@main def main = Test.foo // error + | ^^^^^^^^ + | class A cannot be accessed as a member of (Test : Test.type) from the top-level definitions in package . + | private class A can only be accessed from object Test. + |--------------------------------------------------------------------------------------------------------------------- + |Inline stack trace + |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + |This location contains code that was inlined from i8194.scala:3 +3 | inline def foo: Int = A().test + | ^ + --------------------------------------------------------------------------------------------------------------------- diff --git a/tests/neg/i8194.scala b/tests/neg/i8194.scala new file mode 100644 index 000000000000..d24910c9504c --- /dev/null +++ b/tests/neg/i8194.scala @@ -0,0 +1,5 @@ +object Test { + private class A() { def test = 42 } + inline def foo: Int = A().test +} +@main def main = Test.foo // error