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

@transient does not work with traits #289

Closed
scabug opened this issue Dec 16, 2007 · 4 comments
Closed

@transient does not work with traits #289

scabug opened this issue Dec 16, 2007 · 4 comments
Assignees

Comments

@scabug
Copy link

scabug commented Dec 16, 2007

When marking fields as @transient within traits, those are not marked tansient in the resulting classes.

@scabug
Copy link
Author

scabug commented Dec 16, 2007

Imported From: https://issues.scala-lang.org/browse/SI-289?orig=1
Reporter: Jan Kriesten (jkriesten)

@scabug
Copy link
Author

scabug commented Dec 21, 2007

@odersky said:
fixed in r13624

@scabug
Copy link
Author

scabug commented Dec 21, 2007

Jan Kriesten (jkriesten) said:
@transient vars with traits are still not transfered into the resulting class as transient fields.

given the following scenario:

trait Log {
  @transient var logger: String = _

  def log = {
    if( logger==null )
      logger = "I'm new here"
    logger
  }
}

object ScalaTest extends Log {

  def main(args : Array[String]) : Unit = {
    System.out.println( log )
  }
}

object ScalaTest should have a transient field 'logger' when the trait's applied. currently, it's generated just as a private field.

regards, --- jan.

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone 2.7.0 deleted

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

No branches or pull requests

2 participants