Skip to content

Commit f2c45a8

Browse files
Alex1005atgodzik
authored andcommitted
Don't module class for unhabitated fields (scala#23634)
Fix scala#23576 [Cherry-picked 17625b5]
1 parent 952e977 commit f2c45a8

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
@@ -663,7 +663,7 @@ object SpaceEngine {
663663
val refined = trace(i"refineUsingParent($tp, $sym1, $mixins)")(TypeOps.refineUsingParent(tp, sym1, mixins))
664664

665665
def containsUninhabitedField(tp: Type): Boolean =
666-
tp.fields.exists { field =>
666+
!tp.typeSymbol.is(ModuleClass) && tp.fields.exists { field =>
667667
!field.symbol.flags.is(Lazy) && field.info.dealias.isBottomType
668668
}
669669

0 commit comments

Comments
 (0)