You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever we perform an inline match we need o bind the matched expression before using it in the RHS of the pattern. This is the correct behavior.
classFoo:inlinedeff(inlinex: Option[Int]) =inline x matchcaseSome(y) => y + y
case _ =>???deftest:Unit=vala:Int=5
f(Some(a))
// val y = a// a + a
Unfortunately, this blocks further optimizations or inline matches. We could introduce an inline bindings to allow those extracted terms to be used as they are. Just like in inline parameters. It would look like
inline x matchcaseSome(inline y) => y + y
then the result of f(Some(a)) would just be a + a.
The text was updated successfully, but these errors were encountered:
Whenever we perform an inline match we need o bind the matched expression before using it in the RHS of the pattern. This is the correct behavior.
Unfortunately, this blocks further optimizations or inline matches. We could introduce an inline bindings to allow those extracted terms to be used as they are. Just like in inline parameters. It would look like
then the result of
f(Some(a))
would just bea + a
.The text was updated successfully, but these errors were encountered: