We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 842323a commit 57912ffCopy full SHA for 57912ff
compiler/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -2528,7 +2528,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
2528
2529
/** Can we enumerate all instantiations of this type? */
2530
def isClosedSum(tp: Symbol): Boolean =
2531
- tp.is(Sealed) && tp.isOneOf(AbstractOrTrait) && !tp.hasAnonymousChild
+ tp.is(Sealed) && !tp.hasAnonymousChild
2532
2533
/** Splits a closed type into a disjunction of smaller types.
2534
* It should hold that `tp` and `decompose(tp).reduce(_ or _)`
tests/pos/13455.scala
@@ -0,0 +1,10 @@
1
+sealed class R
2
+
3
+type X[T] = T match {
4
+ case R => String
5
+ case (z => r) => Int
6
+}
7
+def x[T]: X[T] = ???
8
9
+def i(i0: Int): Unit = ???
10
+val a = i(x[Int => String])
0 commit comments