diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-12 16:54:49 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-12 20:47:39 -0700 |
commit | f5e71796d5b964026f5723318d29be5b189b442e (patch) | |
tree | 39926b10b22d920555244622655b27c104cc37ee /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 5f674e44c5d3dccb55ce080c60d92b8e412d03ac (diff) | |
download | scala-f5e71796d5b964026f5723318d29be5b189b442e.tar.gz scala-f5e71796d5b964026f5723318d29be5b189b442e.tar.bz2 scala-f5e71796d5b964026f5723318d29be5b189b442e.zip |
Better error message for pattern arity errors.
Because friends don't tell friends:
"wrong number of arguments for <none>"
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index d90141b732..73ccdeec2c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3237,7 +3237,7 @@ trait Typers extends Modes with Adaptations with Tags { val nbSubPats = args.length val (formals, formalsExpanded) = extractorFormalTypes(resTp, nbSubPats, fun1.symbol) - if (formals == null) duplErrorTree(WrongNumberArgsPatternError(tree, fun)) + if (formals == null) duplErrorTree(WrongNumberOfArgsError(tree, fun)) else { val args1 = typedArgs(args, mode, formals, formalsExpanded) // This used to be the following (failing) assert: @@ -5452,7 +5452,7 @@ trait Typers extends Modes with Adaptations with Tags { // as a compromise, context.enrichmentEnabled tells adaptToMember to go ahead and enrich, // but arbitrary conversions (in adapt) are disabled // TODO: can we achieve the pattern matching bit of the string interpolation SIP without this? - context.withImplicitsDisabledAllowEnrichment(typed(tree, PATTERNmode, pt)) + typingInPattern(context.withImplicitsDisabledAllowEnrichment(typed(tree, PATTERNmode, pt))) } /** Types a (fully parameterized) type tree */ |