File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1158,7 +1158,7 @@ object Types {
11581158 * Overridden and cached in OrType.
11591159 */
11601160 def atoms (implicit ctx : Context ): Set [Type ] = dealias match {
1161- case tp : SingletonType if tp.isStable =>
1161+ case tp : SingletonType =>
11621162 def normalize (tp : Type ): Type = tp match {
11631163 case tp : SingletonType =>
11641164 tp.underlying.dealias match {
@@ -1172,7 +1172,7 @@ object Types {
11721172 case _ => tp
11731173 }
11741174 val underlyingAtoms = tp.underlying.atoms
1175- if (underlyingAtoms.isEmpty) Set .empty + normalize(tp)
1175+ if (underlyingAtoms.isEmpty && tp.isStable ) Set .empty + normalize(tp)
11761176 else underlyingAtoms
11771177 case tp : ExprType => tp.resType.atoms
11781178 case tp : OrType => tp.atoms // `atoms` overridden in OrType
Original file line number Diff line number Diff line change 1+ class Z
2+ class O
3+ object Test0 {
4+ def foo (x : Z | O ) = ()
5+ def bar : Z | O = O ()
6+ foo(bar)
7+ }
8+
9+ object Test {
10+ def foo (x : 0 | 1 ) = ()
11+ def bar : 0 | 1 = 0
12+ foo(bar)
13+ }
14+
You can’t perform that action at this time.
0 commit comments