I noticed that if a case class is deprecated its companion object is not.
scala> @deprecated case class A(x: Int)
warning: there was one deprecation warning; re-run with -deprecation for details
defined class A
scala> A(0)
res0: A = A(0)
scala> new A(0)
warning: there was one deprecation warning; re-run with -deprecation for details
res1: A = A(0)
I would like to get a warning for A(0)
exactly as I get it for new A(0)
. Should I define the companion object explicitly and deprecate it ? Is there any better way ?