slick/slick — pull request #106 by szeiger (2013-02-21 17:26:39+00:00)
Title: Remove Filter nodes with a LiteralNode(true) as the filter condition.

This used to work in ScalaQuery but was broken at some point during the
transition to the new AST. It did go by unnoticed because a bug in Scala
2.10.0 prevented these filter calls from being generated in the first
place (https://issues.scala-lang.org/browse/SI-6968). As a further
complication, the existing code for removing these nodes in
Filter.nodeDelegate along with an unnecessary Node.apply call in Dump
made them disappear from the AST dumps even though they were still in
the tree!

The fix for SI-6968 in Scala 2.10.1-RC1 finally caused failures due to
the unexpected query shape (with an unnecessary Filter) when dealing
with GroupBy nodes in convertToComprehensions.

This fix removes the extra Node.apply in Dump and the "hidden" narrowing
in Filter.nodeDelegate, replacing it with an explicit factory method
Filter.ifRefutable.

Fixes issue #105. Testable by switching to Scala 2.10.1-RC1.

Review by @cvogt