Closed
Description
Compiler version
3.0.0
Minimized code
First sample
transparent inline def transform(inline a: Any): Any = inline a match {
case x: Byte => x
case x: Short => x
case x: Int => x
case x: Long => x
case x: Float => x
case x: Double => x
case _ => a
}
@main def test = {
println(transform(0) < 5)
}
Second sample
transparent inline def transform(inline a: Any): Any = inline a match {
case x: Byte => x
case x: Short => x
case x: Int => x
case x: Long => x
case x: Float => x
case x: Double => x
case _ => a
}
inline def lt(inline a: Any, inline b: Double): Boolean = transform(a) < b
@main def test = {
println(lt(0, 5))
}
Expectation
The first sample compiles as expected.
The second sample doesn't compile but should. In lt
, the transform
call is fully inlined so I assume the compiler should be able to find the right return type.