runtime/compile time reflection doesn't see all knownDirectSubclasses #7046
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7046?orig=1 |
@xeno-by said: |
@xeno-by said: |
@xeno-by said: |
@adriaanm said: |
@JamesIry said: |
Valentin Churavy (wallnuss) said (edited on Dec 10, 2013 6:46:40 AM UTC): |
@adriaanm said: |
Valentin Churavy (wallnuss) said: |
@xeno-by said: |
@xeno-by said: |
@milessabin said: |
@Blaisorblade said:
|
@xeno-by said: One way to fix this issue without changing the typechecker is to move macro expansion to after typer instead of during typer. We'll have to experiment with this, because there are some technical difficulties with implementing that (e.g. implicit inference not working well after typer, etc). |
@milessabin said: |
@cchantep said: val cls: ClassSymbol = sub.asClass
println(s"knownDirectSubclasses = ${cls.knownDirectSubclasses}")
// print "knownDirectSubclasses = Set()"
val subsub = cls.owner.typeSignature.decls.filter {
case c: ClassSymbol =>
cls != c && c.selfType.baseClasses.contains(cls)
case _ => false
}
println(s"subsub = $subsub")
// print the actual sub classes |
@milessabin said: |
@adriaanm said: |
@adriaanm said: |
Unlike, say, annotations or flags, knownDirectSubclasses doesn't get auto-populated and requires a symbol to be pre-initialized to work correctly.
The text was updated successfully, but these errors were encountered: