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

Inference in varargs with Array causes compiler error in 2.8.1 RC1

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Misc Compiler
    • Labels:
      None

      Description

      The following compiles with scala 2.8.0:

      package test
      
      class Test {
      
        def foo: Unit = bar(Array(): _*)
        
        def bar(values: AnyRef*): Unit = ()
      }
      

      With 2.8.1 RC1, an error is issued:

      test/Test.scala:5: error: type mismatch;
       found   : scala.reflect.Manifest[Nothing]
       required: scala.reflect.ClassManifest[T]
        def foo: Unit = bar(Array(): _*)
      

      bar(Array[AnyRef](): _*) compiles with both versions.

        Activity

        Hide
        Paul Phillips added a comment -

        r22727 is the culprit.

        Show
        Paul Phillips added a comment - r22727 is the culprit.
        Hide
        Adriaan Moors added a comment -

        (In r23128) closes SI-3859. need to instantiate type parameters to nothing explicitly in manifestOfType's searchresult rather than relying on later calls to instantiate.

        review by odersky

        Show
        Adriaan Moors added a comment - (In r23128) closes SI-3859 . need to instantiate type parameters to nothing explicitly in manifestOfType's searchresult rather than relying on later calls to instantiate. review by odersky
        Hide
        Adriaan Moors added a comment -

        (In r23129) partial revert of r23128 ("see SI-3859. need to instantiate type parameters to nothing explicitly in manifestOfType's searchresult rather than relying on later calls to instantiate."): the isArray_apply test cleanup was not a good idea (my pre-commit automated testing turned out to be broken.. me.gitfu--)

        no review

        Show
        Adriaan Moors added a comment - (In r23129) partial revert of r23128 ("see SI-3859 . need to instantiate type parameters to nothing explicitly in manifestOfType's searchresult rather than relying on later calls to instantiate."): the isArray_apply test cleanup was not a good idea (my pre-commit automated testing turned out to be broken.. me.gitfu--) no review

          People

          • Assignee:
            Adriaan Moors
            Reporter:
            Ismael Juma
            TracCC:
            Paul Phillips, Seth Tisue
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development