We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac84047 commit 76ba6b2Copy full SHA for 76ba6b2
compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -497,6 +497,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
497
def refine(parent: Type, child: Symbol): Type = {
498
if (child.isTerm && child.is(Case, butNot = Module)) return child.termRef // enum vals always match
499
500
+ if (child.name == tpnme.LOCAL_CHILD) return child.typeRef
501
+
502
val childTp = if (child.isTerm) child.termRef else child.typeRef
503
504
val resTp = instantiate(childTp, parent)(ctx.fresh.setNewTyperState())
tests/patmat/i4315.scala
@@ -0,0 +1,8 @@
1
+import scala.concurrent.duration.{Duration, FiniteDuration}
2
3
+class Test {
4
+ def test(d: Duration) = d match {
5
+ case finite: FiniteDuration =>
6
+ case d =>
7
+ }
8
+}
0 commit comments