Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lrytz opened this issue Oct 18, 2018 · 2 comments
Open
Labels
backend fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
Milestone

Comments

@lrytz
Copy link
Member

lrytz commented Oct 18, 2018

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.

@SethTisue SethTisue added this to the Backlog milestone Oct 18, 2018
@SethTisue
Copy link
Member

SethTisue commented Jan 26, 2024

(Not sure what the right label is to apply here — "backend" typically refers to GenBCode, but uncurry is somewhere in the "middle end".)

@sjrd
Copy link
Member

sjrd commented Jan 26, 2024

Fixed in Scala 3 by scala/scala3#18619

@sjrd sjrd added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
Projects
None yet
Development

No branches or pull requests

3 participants