diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index 229545a57107..fe2983896e8c 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 000000000000..8394a86df025 --- /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