Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Compiler crash related to abstract types and @specialized type parameter #4957
The attached file Vector.scala crashes the Scala compiler. Please see the attached stack trace.
The source code should be self-explanatory. I'm trying to write immutable versions of some java.awt.geom classes, with implicit conversions from/to the AWT versions. This turned out to be much harder than expected. For the last two weeks I've been struggling with Scala's type system, including some compiler crashes, but I've never been able to isolate any of them so I could file a decent bug report.
The offending line is the scalar multiplication in line 50. If you take it away, it compiles fine. If you take away the @specialized, it compiles too.
The latter could be a workaround, but I want T to be specialized. Regarding the "C#I": it looks kind of weird, but it's the best solution I've been able to find. If there's a better one, I would be glad to hear about it.
Imported From: https://issues.scala-lang.org/browse/SI-4957?orig=1