Skip to content

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

Open
@lrytz

Description

@lrytz

Suggested in scala/scala#7312 (comment)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendfixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions