Skip to content

Commit

Permalink
Consider TypeBounds not fully instantiated
Browse files Browse the repository at this point in the history
  • Loading branch information
mbovel committed Mar 7, 2023
1 parent 9b15b2e commit 50ff047
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2725,7 +2725,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
x && {
t.dealias match {
case tp: TypeRef if !tp.symbol.isClass => false
case _: SkolemType | _: TypeVar | _: TypeParamRef => false
case _: SkolemType | _: TypeVar | _: TypeParamRef | _: TypeBounds => false
case _ => foldOver(x, t)
}
}
Expand Down
13 changes: 13 additions & 0 deletions tests/pos/i16869.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class C[T]

type Foo[T] = T match
case C[true] => true
case C[false] => false

class W[T] extends C[Foo[T]]

def f[T <: C[?]](t: T) = W[T]()

def test =
val b = C[true]()
f(b): C[true]

0 comments on commit 50ff047

Please sign in to comment.