Skip to content

Commit

Permalink
Stop rewriting withFilter to filter
Browse files Browse the repository at this point in the history
This was dropped for Scala 2 in scala/scala#5252 for
2.12.0-RC1, as discussed for instance in
scala/bug#6455 and
scala/bug#8339.
  • Loading branch information
Blaisorblade committed May 30, 2018
1 parent be6ae0e commit b2b7a4f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
5 changes: 0 additions & 5 deletions compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,6 @@ class Typer extends Namer
// SI-3120 Java uses the same syntax, A.B, to express selection from the
// value A and from the type A. We have to try both.
selectWithFallback(tryJavaSelectOnType(_)) // !!! possibly exponential bcs of qualifier retyping
else if (tree.name == nme.withFilter && tree.getAttachment(desugar.MaybeFilter).isDefined)
selectWithFallback {
implicit ctx =>
typedSelect(untpd.cpy.Select(tree)(tree.qualifier, nme.filter), pt) // !!! possibly exponential bcs of qualifier retyping
}
else
typeSelectOnTerm(ctx)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/untried/neg/t6455.scala → tests/neg/t6455.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ object O { def filter(p: Int => Boolean): O.type = this }

class Test {
// should not compile because we no longer rewrite withFilter => filter under -Xfuture
O.withFilter(f => true)
O.withFilter(f => true) // error // error
}
4 changes: 0 additions & 4 deletions tests/untried/neg/t6455.check

This file was deleted.

0 comments on commit b2b7a4f

Please sign in to comment.