Uploaded image for project: '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
      

        Attachments

          Activity

          Hide
          mattrussell Matt Russell added a comment -

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

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

          Doesn't close without a test case.

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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: