2.12.0-RC1: very strange results when reflecting vars

46 views
Skip to first unread message

Eugene Burmako

unread,
Sep 8, 2016, 11:32:06 AM9/8/16
to scala-internals
class Test {
  var x = 2
}

object Test {
  def main(args: Array[String]): Unit = {
    import scala.reflect.runtime.universe._
    typeOf[Test].decls.foreach(println)
  }
}

17:30 ~/Projects/2118/sandbox (HEAD)$ scalac Test.scala && scala Test
constructor Test
method x
method x_=
variable x

17:31 ~/Projects/2120RC1/sandbox (HEAD)$ scalac Test.scala && scala Test
constructor Test
variable x
variable x
variable x

Is this intended?

Adriaan Moors

unread,
Sep 8, 2016, 1:00:14 PM9/8/16
to scala-internals
That's not great. We should tweak private def symbolKind: SymbolKind some more.

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages