bug
bug copied to clipboard
Avoid lifting try block in argument of static method into separate methods
Suggested in https://github.com/scala/scala/pull/7312#issuecomment-430893978
class C {
def b = 0
def t = java.util.Collections.singletonList(try b catch { case _: ClassCastException => b })
}
The argument is lifted into a method by uncurry, but that's not necessary as there's no value on the stack.
(Not sure what the right label is to apply here — "backend" typically refers to GenBCode, but uncurry is somewhere in the "middle end".)
Fixed in Scala 3 by https://github.com/lampepfl/dotty/pull/18619