Skip to content

Commit c1db1b0

Browse files
committed
Normalize atoms in depth
1 parent 5069c08 commit c1db1b0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,16 @@ object Types {
10861086
*/
10871087
def atoms(implicit ctx: Context): Set[Type] = dealias match {
10881088
case tp: SingletonType if tp.isStable =>
1089-
def normalize(tp: SingletonType): SingletonType = tp.underlying match {
1090-
case tp1: SingletonType => normalize(tp1)
1089+
def normalize(tp: Type): Type = tp match {
1090+
case tp: SingletonType =>
1091+
tp.underlying.dealias match {
1092+
case tp1: SingletonType => normalize(tp1)
1093+
case _ =>
1094+
tp match {
1095+
case tp: TermRef => tp.derivedSelect(normalize(tp.prefix))
1096+
case _ => tp
1097+
}
1098+
}
10911099
case _ => tp
10921100
}
10931101
Set.empty + normalize(tp)

0 commit comments

Comments
 (0)