We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 866ac14 commit 047a449Copy full SHA for 047a449
compiler/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -601,7 +601,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
601
case OrType(tp21, tp22) =>
602
if (tp2.atoms.nonEmpty && canCompare(tp2.atoms))
603
return tp1.atoms.nonEmpty && tp1.atoms.subsetOf(tp2.atoms) ||
604
- tp1.isRef(NothingClass)
+ tp1.widen.isRef(NothingClass)
605
606
// The next clause handles a situation like the one encountered in i2745.scala.
607
// We have:
tests/pos/singlesubtypes.scala
@@ -0,0 +1,12 @@
1
+object E {
2
+ val a: String = ???
3
+ val b: String = ???
4
+}
5
+
6
+object Test {
7
8
+ val a: E.a.type = E.a
9
+ val b: E.b.type = E.b
10
11
+ val c: a.type | b.type = ???
12
0 commit comments