Closed scabug closed 12 years ago
Imported From: https://issues.scala-lang.org/browse/SI-6277?orig=1 Reporter: @dcsobral Affected Versions: 2.10.0-M6, 2.10.0-M7, 2.10.0 Other Milestones: 2.10.0
@paulp said: I don't know how to deliver this bit of news, other than to say that I hope you're impressed at the few things we do manage to fix in such a hostile environment. That we are on the verge of exporting this behavior into userland is not something I can bear to consider.
scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._
scala> val sym = typeOf[scala.collection.immutable.List[_]].typeSymbol.asClass
sym: reflect.runtime.universe.ClassSymbol = class List
scala> sym.isSealed
res0: Boolean = false
scala> { sym.typeSignature ; () }
scala> sym.isSealed
res2: Boolean = true
@dcsobral said: And here was I saying Symbols were immutable at runtime (despite your presentation -- Eugene was very emphatic on them being immutable at runtime, when he reviewed my blog post saying otherwise).
Other than that, I've been impressed for a long time, and I think you understate the case when you say "few".
@odersky said: I think this is important to fix before 2.10 RC1: Any flags tests need to make sure the symbol is fully loaded when called from reflection, and the flags method needs to do the same. However, in the compiler we must not change behavior. Maybe this means we need to find different names for the exposed flag testing methods.
@xeno-by said: Okay I'm on it. Sorry for neglecting this issue yesterday - I'm in the middle of an exam prep. Also Daniel I'm sorry about misinforming you.
@xeno-by said: @odersky. I suggest we mix the auto-initialization logic into runtime reflection Symbols in the same way we mix in SynchronizedSymbol. This way we'll also get rid of the ugliness of the annotation/getAnnotation dilemma.
@heathermiller said: Scala core meeting consensus: go with Eugene's suggestion
@odersky said: @xeno.by yes, I think this is the way to go. Can you do it?
@xeno-by said: Sure, I will submit a pull request within a week.
@xeno-by said: https://github.com/scala/scala/pull/1264
@jsuereth said: pull request was dropped.
@xeno-by said: https://github.com/scala/scala/pull/1380
It seems
isSealed
is not working at runtime. At least, it doesn't work forList
:upd. This also plagues annotation-getting methods as described in #6428. In the interest of full disclosure, I should mention that privateWithin is also affected.