Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patmat: not enough arguments for method body%41 #4651

Closed
scabug opened this issue May 26, 2011 · 2 comments
Closed

patmat: not enough arguments for method body%41 #4651

scabug opened this issue May 26, 2011 · 2 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented May 26, 2011

Pasting the following snippet into the interpreter leads to a crash of the interpreter:

def analyze(x: Any) = x match {
  case s: String => println("It's a string: " + s)
  case 1 => println("It's a one")
  case (a: Int, b) => println("It's a pair of and int " + a +
                              " and something " + b)
  case 1 :: 2 :: _ => println("It's a list starting with 1, 2")
  case List(a, b, c) => println("It's a three-element list with " +
                                a + ", " + b + ", " + c)
  case _ => println("It's something different")
}

Here's the beginning of the interpreter's output:

<console>:13: warning: No binding
         case List(a, b, c) => println("It's a three-element list with " +
                   ^
<console>:13: warning: No binding
         case List(a, b, c) => println("It's a three-element list with " +
                      ^
<console>:13: warning: No binding
         case List(a, b, c) => println("It's a three-element list with " +
                         ^
scala.tools.nsc.symtab.Types$TypeError: not enough arguments for method body%41: (val a: A, val b: A, val c: A)Unit.
Unspecified value parameters a, b, c.
        at scala.tools.nsc.typechecker.Contexts$Context.error(Contexts.scala:291)
        at scala.tools.nsc.typechecker.Infer$Inferencer.error(Infer.scala:205)
        at scala.tools.nsc.typechecker.Infer$Inferencer.errorTree(Infer.scala:209)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryNamesDefaults$1$4.apply(Typers.scala:2395)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryNamesDefaults$1$4.apply(Typers.scala:2395)
        at scala.Option.getOrElse(Option.scala:109)
        at scala.tools.nsc.typechecker.Typers$Typer.tryNamesDefaults$1(Typers.scala:2395)
        at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:2405)
        at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:3344)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4062)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4217)
@scabug
Copy link
Author

scabug commented May 26, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4651?orig=1
Reporter: Stefan Wehr (stefanwehr)
Affected Versions: 2.9.0

@scabug
Copy link
Author

scabug commented May 11, 2012

@soc said:
Fixed in scala/scala@4c04213

@scabug scabug closed this as completed May 11, 2012
@scabug scabug added the repl label Apr 7, 2017
@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants