Skip to content

Commit cd32c6f

Browse files
authored
chore: add regression test for #8194 (#24655)
I believe there is nothing to do for #8194. I've added it to our test suite and checked the error message since its structure is part of why I believe there is nothing to do. Closes #8194
2 parents c3c121c + 8184903 commit cd32c6f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tests/neg/i8194.check

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- [E173] Reference Error: tests/neg/i8194.scala:5:22 ------------------------------------------------------------------
2+
5 |@main def main = Test.foo // error
3+
| ^^^^^^^^
4+
| class A cannot be accessed as a member of (Test : Test.type) from the top-level definitions in package <empty>.
5+
| private class A can only be accessed from object Test.
6+
|---------------------------------------------------------------------------------------------------------------------
7+
|Inline stack trace
8+
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9+
|This location contains code that was inlined from i8194.scala:3
10+
3 | inline def foo: Int = A().test
11+
| ^
12+
---------------------------------------------------------------------------------------------------------------------

tests/neg/i8194.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object Test {
2+
private class A() { def test = 42 }
3+
inline def foo: Int = A().test
4+
}
5+
@main def main = Test.foo // error

0 commit comments

Comments
 (0)