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

2.12 transient lazy val regression #10075

Closed
scabug opened this issue Nov 22, 2016 · 3 comments
Closed

2.12 transient lazy val regression #10075

scabug opened this issue Nov 22, 2016 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Nov 22, 2016

There seem to be a regression in handling transient lazy vals in 2.12. In 2.11.8, the backing field seems to be marked as transient, while in 2.12.0 it doesn't seem to. (Full example: https://gist.github.com/durban/8c2ffdc426b89fd379ea9699f63464e8)

class MyClass // not Serializable

class TestClass extends Serializable {

  @transient
  lazy val foo: MyClass =
    new MyClass
}

Relevant javap output in 2.11.8:

public class TestClass implements scala.Serializable {
  private transient MyClass foo;
...

And in 2.12.0:

public class TestClass implements scala.Serializable {
  private MyClass foo;
...
@scabug
Copy link
Author

scabug commented Nov 22, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10075?orig=1
Reporter: Daniel Urban (durban)
Affected Versions: 2.12.0

@scabug
Copy link
Author

scabug commented Nov 30, 2016

@adriaanm said:
Thanks for the great report! Working on it. Sorry for the breakage.

@scabug
Copy link
Author

scabug commented Nov 30, 2016

@adriaanm said:
scala/scala#5570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants