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
According to SIP-15, "Universal traits may have neither fields nor initialization statements." Nested objects are effectively both.
trait U extends Any { def x: Int object X { lazy val y = { println("x: " + x); x } var yy = x } } class V(val x: Int) extends AnyVal with U object W { def main(args: Array[String]) { val v = new V(3) val z = v.X.y v.X.yy = 30 val z2 = v.X.y val v2 = new V(4) v2.X.yy = 31 println(z) println(z2) println(v.X.yy) println(v2.X.yy) } }
Output:
x: 3 x: 3 3 3 3 4
Output without extends AnyVal:
extends AnyVal
x: 3 3 3 30 31
I'm not sure if nested classes and traits should be excluded as well, but it might be safer to start by excluding them.
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-6408?orig=1 Reporter: @harrah Affected Versions: 2.10.0 Other Milestones: 2.10.0
Sorry, something went wrong.
@jsuereth said: hey martin, throwing one your way, please punt to whoever is appropriate, thanks!
@odersky said: scala/scala#1366
@odersky said: Greg has taken this one over.
@gkossakowski said: Fixed in scala/scala#1443
gkossakowski
No branches or pull requests
According to SIP-15, "Universal traits may have neither fields nor initialization statements." Nested objects are effectively both.
Output:
Output without
extends AnyVal
:I'm not sure if nested classes and traits should be excluded as well, but it might be safer to start by excluding them.
The text was updated successfully, but these errors were encountered: