summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
diff options
context:
space:
mode:
authorDen Shabalin <den.shabalin@gmail.com>2013-09-05 20:41:48 +0200
committerDen Shabalin <den.shabalin@gmail.com>2013-09-05 20:42:10 +0200
commit546e94099d667c6395582fcba321ef95578121a5 (patch)
tree6c250294e163c0aa008d117b5e994003174857fe /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
parent1352fea1c4ecfa0fd66ff1d5ad6e0ee437b1a59f (diff)
downloadscala-546e94099d667c6395582fcba321ef95578121a5.tar.gz
scala-546e94099d667c6395582fcba321ef95578121a5.tar.bz2
scala-546e94099d667c6395582fcba321ef95578121a5.zip
SI-7803 support for matching of anonymous function literals
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index f52ed60480..70b32f08ae 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -1445,7 +1445,7 @@ self =>
// The case still missed is unparenthesized single argument, like "x: Int => x + 1", which
// may be impossible to distinguish from a self-type and so remains an error. (See #1564)
def lhsIsTypedParamList() = t match {
- case Parens(xs) if xs forall (_.isInstanceOf[Typed]) => true
+ case Parens(xs) if xs.forall(isTypedParam) => true
case _ => false
}
if (in.token == ARROW && (location != InTemplate || lhsIsTypedParamList)) {
@@ -1458,6 +1458,8 @@ self =>
parseOther
}
+ def isTypedParam(t: Tree) = t.isInstanceOf[Typed]
+
/** {{{
* Expr ::= implicit Id => Expr
* }}}