Closed
Description
Minimized code
class C:
type X <: Tuple
inline def f(c: C): Unit = {
inline val size = compiletime.constValue[Tuple.Size[c.X]]
val n = size
val m: Int = n
???
}
def test: Unit = f(??? : C { type X = Tuple1[Any] })
Output
result after typer:
...
def test: Unit =
{
val c: C{X = Tuple1[Any]} =
??? :
C
{
type X = Tuple1[Any]
}
{
inline val size: (1 : Int) = 1
val n: (1 : Int) = size
val m: Int = n
???
}:Unit
}
...
result after genBCode:
...
def test(): Unit =
{
val c: C = ???():C
{
{
inline val size: Int = 1
val n: Int = size
val m: Int = n
???()
}:scala.runtime.BoxedUnit
()
}
}
...
Expectation
The reference to size
should be replaced by the literal constant 1
. This is needed to ensure that all local inline vals can be erased.