Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0-M2
    • Component/s: None
    • Labels:
      None

      Description

      scala> (List(1,2), List("a", "b"), List("c", "d")).zipped.map((x,y,z) => (y,x,z))
      res0: List[(String, Int, String)] = List((a,1,c), (b,2,d))
      
      scala> (List(1,2), List("a", "b"), List("c", "d")).zipped.map(_._1)
      <console>:8: error: wrong number of parameters; expected = 3
                    (List(1,2), List("a", "b"), List("c", "d")).zipped.map(_._1)
                                                                             ^
      error: no-symbol does not have an owner (this is a bug: scala version 2.10.0-20120411-064552-c80d4afa1f)
      

      The compiler correctly shows the error:

      $ cat Test.scala
      object Test extends App {
        println((List(1,2), List("a", "b"), List("c", "d")).zipped.map(_._1))
      }
      $ scalac Test.scala 
      Test.scala:2: error: wrong number of parameters; expected = 3
        println((List(1,2), List("a", "b"), List("c", "d")).zipped.map(_._1))
                                                                         ^
      one error found
      

      PS: Don't mind the git hash that isn't in trunk yet, I was working on scaladoc.

        Activity

        Hide
        Paul Phillips added a comment -

        Sadly this has been inflicted upon me by the compiler, which used to throw errors where I could catch them but now reports them before I get a chance.

        Show
        Paul Phillips added a comment - Sadly this has been inflicted upon me by the compiler, which used to throw errors where I could catch them but now reports them before I get a chance.
        Hide
        Kato Kazuyoshi added a comment -

        Fixed?

        % ./build/pack/bin/scala
        Welcome to Scala version 2.10.0-20120422-061223-8c95273b70 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31).
        Type in expressions to have them evaluated.
        Type :help for more information.
        
        scala> (List(1,2), List("a", "b"), List("c", "d")).zipped.map((x,y,z) => (y,x,z))
        res0: List[(String, Int, String)] = List((a,1,c), (b,2,d))
        
        scala> (List(1,2), List("a", "b"), List("c", "d")).zipped.map(_._1)
        <console>:8: error: wrong number of parameters; expected = 3
                      (List(1,2), List("a", "b"), List("c", "d")).zipped.map(_._1)
                                                                               ^
        
        scala> 
        
        Show
        Kato Kazuyoshi added a comment - Fixed? % ./build/pack/bin/scala Welcome to Scala version 2.10.0-20120422-061223-8c95273b70 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31). Type in expressions to have them evaluated. Type :help for more information. scala> (List(1,2), List("a", "b"), List("c", "d")).zipped.map((x,y,z) => (y,x,z)) res0: List[(String, Int, String)] = List((a,1,c), (b,2,d)) scala> (List(1,2), List("a", "b"), List("c", "d")).zipped.map(_._1) <console>:8: error: wrong number of parameters; expected = 3 (List(1,2), List("a", "b"), List("c", "d")).zipped.map(_._1) ^ scala>
        Hide
        Vlad Ureche added a comment -

        Guess so, if trunk works fine.

        Show
        Vlad Ureche added a comment - Guess so, if trunk works fine.

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Vlad Ureche
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development