aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-06-06 17:44:28 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-06-06 18:43:37 +0200
commit2414bfeda301410fe64f8adddd22a24a15621850 (patch)
treed24b5fcdc0a8c2aa22b6df6548b470623c8d763b /src/dotty/tools/dotc/typer/Typer.scala
parent04b0e85c70de36fd7b5a4b3ffd1b8add0963303d (diff)
downloaddotty-2414bfeda301410fe64f8adddd22a24a15621850.tar.gz
dotty-2414bfeda301410fe64f8adddd22a24a15621850.tar.bz2
dotty-2414bfeda301410fe64f8adddd22a24a15621850.zip
Fix issue with GADT not typechecking without bind in match
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 4f27912f1..734f1c660 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1653,7 +1653,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
case SearchSuccess(inferred, _, _) =>
adapt(inferred, pt)
case failure: SearchFailure =>
- if (pt.isInstanceOf[ProtoType] && !failure.isInstanceOf[AmbiguousImplicits]) tree
+ if (
+ pt.isInstanceOf[ProtoType] && !failure.isInstanceOf[AmbiguousImplicits] ||
+ tree.tpe.<:<(pt)(ctx.addMode(Mode.GADTflexible))
+ ) tree
else err.typeMismatch(tree, pt, failure)
}
}