Skip to content

Commit 50ff047

Browse files
committed
Consider TypeBounds not fully instantiated
1 parent 9b15b2e commit 50ff047

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2725,7 +2725,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
27252725
x && {
27262726
t.dealias match {
27272727
case tp: TypeRef if !tp.symbol.isClass => false
2728-
case _: SkolemType | _: TypeVar | _: TypeParamRef => false
2728+
case _: SkolemType | _: TypeVar | _: TypeParamRef | _: TypeBounds => false
27292729
case _ => foldOver(x, t)
27302730
}
27312731
}

tests/pos/i16869.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)