-
Notifications
You must be signed in to change notification settings - Fork 21
case classes, implementing the Universe *Extractor interfaces, and assertion failure #3137
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
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3137?orig=1 |
@ingoem said: |
Nate Nystrom (nystrom) said: trait A {
type C
def C: Int => C
}
class B extends A {
case class C(v: Int)
} I get the following with scalac 2.8.0.Beta1-prerelease on Java 1.6.0_17-b04-248-10M3025 on OS X 10.6.2: java.lang.AssertionError: assertion failed: List(object C, object C)
at scala.tools.nsc.symtab.Symbols$$Symbol.suchThat(Symbols.scala:1058)
at scala.tools.nsc.symtab.Symbols$$Symbol.linkedModuleOfClass0(Symbols.scala:1261)
at scala.tools.nsc.symtab.Symbols$$Symbol.linkedModuleOfClass(Symbols.scala:1269)
at scala.tools.nsc.symtab.Symbols$$Symbol.linkedClassOfClass(Symbols.scala:1291)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator$$$$anonfun$$addInnerClasses$$1.apply(GenJVM.scala:511)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator$$$$anonfun$$addInnerClasses$$1.apply(GenJVM.scala:509)
... |
@paulp said: trait A {
val C: Any
}
class B extends A {
class C
object C
} |
@dubochet said: |
I have just finished an "EmptyUniverse" implementing the various scala.reflect.generic._ bits. There are a bunch of abstract extractor interfaces, which the compiler implements like so:
Not sure I would have guessed to even try that as a means of using synthetic methods to implement an interface. Are we suggesting by virtue of embedding it in the reflection interface that it's a mechanism people can expect to keep working?
In any case, it does work if you mimic the compiler structure, having individual traits extending the generic traits, and then mixing them together in Universe. However if you try it directly in the class, like this:
Then you get the assertion failure seen previously in #2130 and #2779, that a duplicated symbol exists.
It trips the assertion even if I explicitly list generic.AnnotationInfos in the MyUniverse parents, so it's not a result of being indirectly inherited.
The text was updated successfully, but these errors were encountered: