Skip to content

Add @volatile to scala2 lazyvals #636

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

Merged
merged 7 commits into from
Jun 18, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 8, 2015

Add @volatile to inherited lazyvals. Right now this dies in backed. Based on #635. @DarkDimius can you take this over?

odersky added 6 commits June 8, 2015 11:04
The logic to add trait setters to Scala 2 traits was wrong. This led
to AbstractMethodErrors in the formerly commented out part of scala-trait.scala.
Implementations inherit all annotations on the implemented trait methods.
For the moment, we keep all annotations on getters and setters, but this could be changed.
Scala-2 lazy vals are @volatile according to Dotty conventions.
Unlike normal fields, they aren't initialised in $init method, and need to know a bit about class layout of implementation class.
Luckily AugmentScala2Traits added just enough symbols to make this work.
@DarkDimius
Copy link
Contributor

@odersky please review last commit.

@odersky odersky merged commit c4c29e3 into scala:master Jun 18, 2015
@allanrenucci allanrenucci deleted the fix/implement-scala2-lazyvals branch December 14, 2017 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants