Closed
Description
Compiler version
v3.1.3 and latest main.
Minimized code
object Opaque:
opaque type A = Int
val va: A = 1
inline def a(x: A) =
x + 1
object Opaque2:
opaque type B = Opaque.A
val vb: B = Opaque.va
inline def b(x: B) = Opaque.a(x)
@main def Test() =
print(Opaque2.b(Opaque2.vb))
Output
-- [E173] Reference Error: Test.scala:17:17 ------------------------------------
17 | print(Opaque2.b(Opaque2.vb))
| ^^^^^^^^^^^^^^^^^^^^^
|+ cannot be accessed as a member of (x$proxy1 : (Opaque2.vb : Opaque2.B) & $proxy1.B) from module class Test$package$.
|----------------------------------------------------------------------------
|Inline stack trace
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from Test.scala:7
7 | x + 1
| ^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from Test.scala:7
14 | inline def b(x: B) = Opaque.a(x)
| ^^^^^^^^^^^
----------------------------------------------------------------------------
Expectation
Should compile fine.
Note that if we remove at least one of the inline
s, everything compiles fine. If we remove at least one of the opaque
s, everything compiles fine.