Skip to content

Commit c9a019c

Browse files
Follow term ref for enum values and modules
This is required to get tests/pos/i10511.scala to pass since that test uses "enum val" knowledge transitivly.
1 parent 78f9951 commit c9a019c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

+4-1
Original file line numberDiff line numberDiff line change
@@ -2480,7 +2480,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
24802480
sym.isAllOf(EnumCase, butNot=JavaDefined)
24812481

24822482
def isEnumValueOrModule(ref: TermRef): Boolean =
2483-
isEnumValue(ref) || ref.termSymbol.is(Module)
2483+
isEnumValue(ref) || ref.termSymbol.is(Module) || (ref.info match {
2484+
case tp: TermRef => isEnumValueOrModule(tp)
2485+
case _ => false
2486+
})
24842487

24852488
/** Can we enumerate all instantiations of this type? */
24862489
def isClosedSum(tp: Symbol): Boolean =

0 commit comments

Comments
 (0)