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
class Example(private[this] var con1: Int, private var con2: Int) { private[this] var field1: Int = -3 private var field2: Int = -3 println("[constructor, before] " + ((con1, con2, field1, field2))) con1 = 75 con2 = 75 field1 = 75 field2 = 75 println("[constructor, after] " + ((con1, con2, field1, field2))) def xValue = ((con1, con2, field1, field2)) } object Test { def main(args: Array[String]) { val example = new Example(-3, -3) println("[post-constructor] " + example.xValue) // prints -3, expected 0. } }
This prints:
[constructor, before] (-3,-3,-3,-3) [constructor, after] (75,75,75,75) [post-constructor] (-3,75,75,75)
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-6880?orig=1 Reporter: @paulp Affected Versions: 2.10.0 See #4762
Sorry, something went wrong.
som-snytt
Successfully merging a pull request may close this issue.
This prints:
The text was updated successfully, but these errors were encountered: