bug icon indicating copy to clipboard operation
bug copied to clipboard

Avoid lifting try block in argument of static method into separate methods

Open lrytz opened this issue 7 years ago • 2 comments

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.

lrytz avatar Oct 18 '18 13:10 lrytz