Skip to content

Commit 21d983c

Browse files
committed
fix irrefutable check
1 parent cd2e68d commit 21d983c

File tree

1 file changed

+2
-1
lines changed
  • compiler/src/dotty/tools/dotc/transform/patmat

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
372372
/* Whether the extractor method type is irrefutable */
373373
def irrefutable(unapp: tpd.Tree): Boolean = {
374374
// TODO: optionless patmat
375-
unapp.tpe.resultType.isRef(scalaSomeClass) || (unapp.symbol.is(allOf(Synthetic, Case)))
375+
unapp.tpe.resultType.isRef(scalaSomeClass) ||
376+
(unapp.symbol.is(Synthetic) && unapp.symbol.owner.linkedClass.is(Case))
376377
}
377378

378379
/** Return the space that represents the pattern `pat`

0 commit comments

Comments
 (0)