Closed
Description
The following fails to compile,
import scala.typelevel._
object Test {
class Box[F[_]]
inline def foo[T] <: Any =
inline erasedValue[T] match {
case _: Box[f] => 23
}
foo[Box[List]]
}
reporting,
11 | foo[Box[List]]
| ^^^^^^^^^^^^^^
|cannot reduce inline match with
| scrutinee: scala.typelevel.erasedValue[Test.Box[List]] : Test.Box[List]
| patterns : case _:Test.Box[f @ _]
| This location is in code that was inlined at tests/pos/hk-inline-match.scala:11
one error found
However, the similar,
import scala.typelevel._
object Test {
class Box[F[_]]
type Foo[T] = T match {
case Box[f] => Int
}
val i: Foo[Box[List]] = 23
}
compiles as expected.