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

            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: