We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Scala version: 2.13.10
class C { final val x = 42 final val y: 42 = 42 def f = x def g = y def f2 = x+1 def g2 = y+1 }
Scala 3 correctly does the same for both, which is no field.
Scala 2 incorrectly or suboptimally has field for y and accessor is invoked for g, but g2 is constant-folded (during type checking).
Noticed at cquiroz/scala-java-time#403 (comment) where
It's hard to reason about this.
Of course, inline addresses these concerns.
inline
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reproduction steps
Scala version: 2.13.10
Problem
Scala 3 correctly does the same for both, which is no field.
Scala 2 incorrectly or suboptimally has field for y and accessor is invoked for g, but g2 is constant-folded (during type checking).
Noticed at cquiroz/scala-java-time#403 (comment) where
Of course,
inline
addresses these concerns.The text was updated successfully, but these errors were encountered: