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

Scalala and @specialized don't get along with Scala 2.9.x

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0-M4
    • Component/s: Specialization
    • Labels:
      None
    • Environment:

      specialization

      Description

      === What steps will reproduce the problem ===

      Checkout Scalala from my repo at the following points.

      Run: sbt update; sbt compile

      Branch: https://github.com/retronym/Scalala/commits/scala-2.9-take2

      https://github.com/retronym/Scalala/tree/b64ee3647f9654d83c58391644e1f6c8c54faacd

      https://github.com/retronym/Scalala/tree/e32202b6c0ee925cbab4d943d5bcbedf37f7aa2d

      === What is the expected behavior? ===

      Successful compilation, as per -no-specialization

      === What do you see instead? ===

      Compilation failure.

      === Additional information ===

      I haven't had time to isolate these yet. But I wanted to post a bug to make this issue visible in the lead up to 2.9.0.

      === What versions of the following are you using? ===

      • Scala: 2.9.0.RC3

        Activity

        Hide
        Daniel Ramage added a comment -

        There are multiple problems - one regarding 'protected' on specialized vars that are constructor parameters (which retronym worked around) and at least one more with no obvious workaround. In both cases the compiler crashes and burns.

        Show
        Daniel Ramage added a comment - There are multiple problems - one regarding 'protected' on specialized vars that are constructor parameters (which retronym worked around) and at least one more with no obvious workaround. In both cases the compiler crashes and burns.
        Hide
        Iulian Dragos added a comment -

        Does it work with 2.8.1?

        Show
        Iulian Dragos added a comment - Does it work with 2.8.1?
        Hide
        Daniel Ramage added a comment -

        Same errors in 2.8.1

        Show
        Daniel Ramage added a comment - Same errors in 2.8.1
        Hide
        Matthew Pocock added a comment -

        I'm still seeing this against 2.9.0-1 when trying to build SparseArray from scalala.

        Show
        Matthew Pocock added a comment - I'm still seeing this against 2.9.0-1 when trying to build SparseArray from scalala.
        Hide
        Aleksandar Prokopec added a comment - - edited

        Can you point me to an example in the source code which uses protected on specialized constructor parameter vars, and the examples of other problems? It would be easier to construct a smaller snippet where this fails and work with that.

        Show
        Aleksandar Prokopec added a comment - - edited Can you point me to an example in the source code which uses protected on specialized constructor parameter vars, and the examples of other problems? It would be easier to construct a smaller snippet where this fails and work with that.
        Hide
        Matthew Pocock added a comment -

        Try to build the SparseArray class with the constructor args set to private. The compilation will fail. You have to scope the protected access to get it to build.

        Show
        Matthew Pocock added a comment - Try to build the SparseArray class with the constructor args set to private. The compilation will fail. You have to scope the protected access to get it to build.
        Hide
        Aleksandar Prokopec added a comment -

        A short failing snippet:

        @SerialVersionUID(1L)
        final class SparseArray[@specialized T](private var data : Array[T]) extends Serializable {
          def use(inData : Array[T]) = {
            data = inData;
          }
          
          def set(that : SparseArray[T]) = {
            use(that.data.clone)
          }
        }
        
        Show
        Aleksandar Prokopec added a comment - A short failing snippet: @SerialVersionUID(1L) final class SparseArray[@specialized T](private var data : Array[T]) extends Serializable { def use(inData : Array[T]) = { data = inData; } def set(that : SparseArray[T]) = { use(that.data.clone) } }
        Hide
        Commit Message Bot added a comment -

        (prokopec in r25988) Work in progress on #4541.

        No review.

        Show
        Commit Message Bot added a comment - (prokopec in r25988 ) Work in progress on #4541. No review.

          People

          • Assignee:
            Aleksandar Prokopec
            Reporter:
            Jason Zaugg
            TracCC:
            Daniel Ramage, Erik Engbrecht
          • Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development