Skip to content

Commit 482959b

Browse files
Alex1005aWojciechMazur
authored andcommitted
Don't module class for unhabitated fields (#23634)
Fix #23576 [Cherry-picked 17625b5]
1 parent b872039 commit 482959b

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ object SpaceEngine {
685685
val refined = trace(i"refineUsingParent($tp, $sym1, $mixins)")(TypeOps.refineUsingParent(tp, sym1, mixins))
686686

687687
def containsUninhabitedField(tp: Type): Boolean =
688-
tp.fields.exists { field =>
688+
!tp.typeSymbol.is(ModuleClass) && tp.fields.exists { field =>
689689
!field.symbol.flags.is(Lazy) && field.info.dealias.isBottomType
690690
}
691691

0 commit comments

Comments
 (0)