Closed
Description
Compiler version
3.0.1
Minimized code
transparent inline def f: String =
inline 10 match
case _ =>
inline Some["foo"]("foo") match
case Some(x) => x
def test =
inline val failMsg = f
Output
8 | inline val failMsg = f
| ^
| inline value must have a literal constant type
Expectation
Should compile.
It looks like the type parameter of the Some.unapply
is widened at some point. I would expect the inline match to be typed as:
inline Some.apply["foo"]("foo") match
case Some.unapply["foo"](x @ _) => x:"foo"