aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-05-06 18:58:56 +0200
committerMartin Odersky <odersky@gmail.com>2016-05-23 16:11:45 +0200
commit4baaa5ac03b165ef9b17922e85ef062460d002c9 (patch)
tree264ce0a0525fdeb17cb7ab18dd00d9a2d628c3d0 /src/dotty/tools/dotc/typer/Typer.scala
parentcd8bf2d69cf1463fa16a69badb2a839f540bb2fa (diff)
downloaddotty-4baaa5ac03b165ef9b17922e85ef062460d002c9.tar.gz
dotty-4baaa5ac03b165ef9b17922e85ef062460d002c9.tar.bz2
dotty-4baaa5ac03b165ef9b17922e85ef062460d002c9.zip
Check equality that with == and != makes sense
This is done by checking each instance of an eqAny implicit so that it does not contain non-bottom instances of equality types as instances.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index b26ff4509..23e7cdb7b 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1594,7 +1594,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
case _ =>
if (ctx.mode is Mode.Pattern) {
tree match {
- case _: RefTree | _: Literal if !isVarPattern(tree) => checkCanEqual(pt, wtp, tree.pos)
+ case _: RefTree | _: Literal if !isVarPattern(tree) =>
+ checkCanEqual(pt, wtp, tree.pos)(ctx.retractMode(Mode.Pattern))
case _ =>
}
tree