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

"wrong number of arguments for object" error using extractor

    Details

      Description

      Using scala-2.10.0.r25759-b20110929023607, compiling the following:

      case class Token(text: String, startIndex: Int)
      
      object Comment {
      
        def unapply(s: String): Option[Token] = None
      
      }
      
      object HiddenTokens {
      
        "foo" match { case Comment(_) => }
      
      }
      

      Gives the error:

      Comment.scala:11: error: wrong number of arguments for object Comment
        "foo" match { case Comment(_) => }
                                  ^
      one error found
      

        Activity

        Hide
        Matt Russell added a comment -

        I don't get the error in scala-2.10.0.r26084-b20111129023531.

        Show
        Matt Russell added a comment - I don't get the error in scala-2.10.0.r26084-b20111129023531.
        Hide
        Paul Phillips added a comment -

        Doesn't close without a test case.

        Show
        Paul Phillips added a comment - Doesn't close without a test case.
        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/630

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Matt Russell
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development