aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliu fengyun <liu@fengy.me>2017-04-13 15:34:51 +0200
committerGitHub <noreply@github.com>2017-04-13 15:34:51 +0200
commit0fe56ea73e6775a315f54772dc6bfb40815c7c98 (patch)
treeb7577f66688ed793a73ff543042a140e62cbe80d
parentde6461ab17562dbb46a1ff094590e051d03cb54c (diff)
parentfb4adc3c9c55476d2fe0deed22cff54e8e945406 (diff)
downloaddotty-0fe56ea73e6775a315f54772dc6bfb40815c7c98.zip
dotty-0fe56ea73e6775a315f54772dc6bfb40815c7c98.tar.gz
dotty-0fe56ea73e6775a315f54772dc6bfb40815c7c98.tar.bz2
Merge pull request #2257 from dotty-staging/fix-2253
Fix #2253: avoid match exception in case of refinement types
-rw-r--r--compiler/src/dotty/tools/dotc/transform/patmat/Space.scala1
-rw-r--r--tests/patmat/i2253.scala7
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
index 229545a..fe29838 100644
--- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
+++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -537,6 +537,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
tp.refinedName,
tpb.derivedTypeBounds(follow(lo, false), follow(hi, true))
)
+ case tp => tp
}
case _ => tp
}
diff --git a/tests/patmat/i2253.scala b/tests/patmat/i2253.scala
new file mode 100644
index 0000000..8394a86
--- /dev/null
+++ b/tests/patmat/i2253.scala
@@ -0,0 +1,7 @@
+sealed trait S
+object O extends S
+trait T
+
+class Test {
+ def m(s: S { val x: Int }) = s match { case _: T => ; }
+} \ No newline at end of file