-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Compiler version
3.7.4, 3.8.0-RC1-bin-20251113-8b5d445-NIGHTLY,
Minimized code
object test {
import scala.compiletime.erasedValue
inline def contains[T <: Tuple, E]: Boolean = inline erasedValue[T] match {
case _: EmptyTuple => false
case _: (_ *: tail) => contains[tail, E]
}
inline def check[T <: Tuple]: Unit = {
inline if contains[T, Long] && false then ???
}
check[(String, Double)]
}Output
[error] ./inline_and.scala:12:3
[error] Cannot reduce `inline if` because its condition is not a constant value: {
[error] {
[error] false:Boolean
[error] }:Boolean
[error] }:Boolean && false
[error] check[(String, Double)]
[error] ^^^^^^^^^^^^^^^^^^^^^^^Expectation
The code should compile.
mbovel