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

Bad reification of @transient @volatile var x = 2 #5225

Closed
scabug opened this issue Nov 26, 2011 · 3 comments
Closed

Bad reification of @transient @volatile var x = 2 #5225

scabug opened this issue Nov 26, 2011 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Nov 26, 2011

import scala.reflect._
import scala.reflect.api._

object Foo extends App {
  println(scala.reflect.Code.lift{
    @transient @volatile var x = 2
  }.tree.toString)
}
transformed = new scala.reflect.Code[Unit]({
  val $mr: scala.reflect.api.Mirror = scala.reflect.`package`.mirror;
  $mr.Block.apply(scala.collection.immutable.List.apply[$mr.ValDef]($mr.ValDef.apply($mr.modifiersFromInternalFlags(4096L, $mr.newTypeName(""), immutable.this.Nil), $mr.newTermName("x"), $mr.TypeTree($mr.staticClass("scala.Int").asTypeConstructor), $mr.Literal.apply($mr.Constant.apply(2)))), $mr.Literal.apply($mr.Constant.apply(())))
}.asInstanceOf[reflect.mirror.Tree])(reflect.this.Manifest.Unit)
D:\Dropbox\Scratchpad\Scala>scala Foo
{
  var x: Int = 2;
  ()
}
@scabug
Copy link
Author

scabug commented Nov 26, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5225?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.0

@scabug
Copy link
Author

scabug commented Nov 26, 2011

@xeno-by said:
I believe this issue also leads to incorrect reification of {code}def foo(@cloneable x: Int) = ""{code}

@scabug
Copy link
Author

scabug commented Feb 13, 2012

@xeno-by said:
Fixed by scala/scala@6548dcf

@scabug scabug closed this as completed Feb 13, 2012
@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
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