Scala Programming Language
  1. Scala Programming Language
  2. SI-4957

Compiler crash related to abstract types and @specialized type parameter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.8.1, Scala 2.9.0, Scala 2.9.1
    • Fix Version/s: Scala 2.10.0
    • Component/s: Misc Compiler
    • Labels:
    • Environment:

      Java 6, OS X

      Description

      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.

      Thanks
      Christoph

      1. stacktrace.txt
        19 kB
        Christoph Radig
      2. Vector.scala
        2 kB
        Christoph Radig

        Activity

        Hide
        Commit Message Bot added a comment -

        (extempore in r25908) Test case closes SI-4957.

        No review.

        Show
        Commit Message Bot added a comment - (extempore in r25908 ) Test case closes SI-4957 . No review.

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Christoph Radig
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development