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 9b15b2e commit 50ff047Copy full SHA for 50ff047
compiler/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -2725,7 +2725,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
2725
x && {
2726
t.dealias match {
2727
case tp: TypeRef if !tp.symbol.isClass => false
2728
- case _: SkolemType | _: TypeVar | _: TypeParamRef => false
+ case _: SkolemType | _: TypeVar | _: TypeParamRef | _: TypeBounds => false
2729
case _ => foldOver(x, t)
2730
}
2731
tests/pos/i16869.scala
@@ -0,0 +1,13 @@
1
+class C[T]
2
+
3
+type Foo[T] = T match
4
+ case C[true] => true
5
+ case C[false] => false
6
7
+class W[T] extends C[Foo[T]]
8
9
+def f[T <: C[?]](t: T) = W[T]()
10
11
+def test =
12
+ val b = C[true]()
13
+ f(b): C[true]
0 commit comments