diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-06-06 17:44:28 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-06-06 18:43:37 +0200 |
commit | 2414bfeda301410fe64f8adddd22a24a15621850 (patch) | |
tree | d24b5fcdc0a8c2aa22b6df6548b470623c8d763b /src | |
parent | 04b0e85c70de36fd7b5a4b3ffd1b8add0963303d (diff) | |
download | dotty-2414bfeda301410fe64f8adddd22a24a15621850.tar.gz dotty-2414bfeda301410fe64f8adddd22a24a15621850.tar.bz2 dotty-2414bfeda301410fe64f8adddd22a24a15621850.zip |
Fix issue with GADT not typechecking without bind in match
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 5 |
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) } } |