Scala

Scala

Made by DeepSource

Invalid deprecated annotation used SC-W1035

Bug risk
Critical

Languages like Java and Scala allow you to annotate a method as deprecated to signify that the method is no longer supported and will be dropped in the near future and that the users must switch to a suitable alternative. However, marking a Scala method with Java's annotation, i.e. @Deprecated is not ideal. Rather, it is suggested that you use the Scala's annotation, i.e. @deprecated as the former may or may not trigger the deprecated message.

Bad practice

@Deprecated()
def foo(): Unit = ???

Recommended

@deprecated()
def foo(): Unit = ???