Closed
Description
Compiler version
3.5.2
Minimized code
class Foo:
inline def inlineMatch[T]: String =
inline compiletime.erasedValue[T] match
case _: EmptyTuple => ""
case _: (h *: _) if checkType[h] => ""
private inline def checkType[T]: Boolean =
inline compiletime.erasedValue[T] match
case _: Int => true
case _ => false
val foo = Foo()
foo.inlineMatch[(Int, Boolean)] // Error
Output
[error] |cannot reduce inline match with
[error] | scrutinee: compiletime.package$package.erasedValue[(Int, Boolean)] : (Int, Boolean)
[error] | patterns : case _:EmptyTuple
[error] | case _:*:[h @ _, _ @ >: Nothing <: Any] if Foo_this.asInstanceOf[Foo].checkType[h]
Expectation
If this is indeed not supposed to work, I would expect a clearer error message.