-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
scala/scala
#9815Description
I'd expect two deprecation warnings (I tried on latest 2.13.x), but get none:
object Test {
class C
@deprecated
type DeprecatedAlias = C
@deprecated
class DeprecatedClass
(??? : Any) match {
case _ : DeprecatedAlias => // should emit warning
case _ : DeprecatedClass => // should emit warning
}
}
I suspect the inPattern
condition in https://github.com/scala/scala/blob/5697b87cf9aafd979533a92a92331874396b8584/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala#L1778-L1779 needs to be pushed into theRefCheckTypeMap
and the skipping needs to a bit more fine-grained: deprecation warnings should be emitted (since pattern matching expansion happens after refchecks, I guess the emitted code evade further checking), but bounds may still need to be ignored.