diff options
author | Paul Phillips <paulp@improving.org> | 2012-03-19 19:44:58 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-03-19 20:13:36 -0700 |
commit | 365bb2b4e3ac880243736bf039b649a63b00ccb2 (patch) | |
tree | 02dbea778484a2dd33bb7112f834ae3aebf2d07b /src/compiler | |
parent | c82ecabad6fc050411495f3fd50c3bf79ac7e96e (diff) | |
download | scala-365bb2b4e3ac880243736bf039b649a63b00ccb2.tar.gz scala-365bb2b4e3ac880243736bf039b649a63b00ccb2.tar.bz2 scala-365bb2b4e3ac880243736bf039b649a63b00ccb2.zip |
Discovered filter was still being generated.
Rather than withFilter, for a subset of for comprehension structures.
Not sure if this was somewhat by design - only seems possible because
refchecks was only looking for nme.filter, not nme.withFilter, so
perhaps this was intended as some secret irrefutability backchannel?
Really have to document that sort of thing if it's intentional. I
assumed it wasn't and unified everything.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala index 80c258e456..0bc88d1efd 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala @@ -269,7 +269,7 @@ abstract class TreeBuilder { ) val matchTree = makeVisitor(cases, false, scrutineeName) - atPos(tree.pos)(Apply(Select(tree, nme.filter), matchTree :: Nil)) + atPos(tree.pos)(Apply(Select(tree, nme.withFilter), matchTree :: Nil)) } /** Create tree for for-comprehension generator <val pat0 <- rhs0> */ diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index ec42d251ff..73369f09af 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1445,7 +1445,7 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R private def transformApply(tree: Apply): Tree = tree match { case Apply( - Select(qual, nme.filter), + Select(qual, nme.filter | nme.withFilter), List(Function( List(ValDef(_, pname, tpt, _)), Match(_, CaseDef(pat1, _, _) :: _)))) |