Closed
Description
(tested with 0.23.0-RC1 only, maybe it has already been fixed upstream?)
Minimized code
sealed trait Foo
case object Qux extends Foo
def problem(foo: Foo): Qux.type = foo match {
case qux: Qux.type => qux
}
https://scastie.scala-lang.org/yJbmLhdYTNivTXwKg4E1wQ
Output
[error] -- [E007] Type Mismatch Error:
[error] | case qux: Qux.type => qux
[error] | ^^^
[error] | Found: (qux : Foo)
[error] | Required: Qux.type
Expectation
qux
should have type Qux.type
instead of Foo
.