views:

126

answers:

1

I was wondering if scala had an equivalent to java's @SuppressWarnings that can be applied to a function or whatever to ignore any deprecation warnings[1] that function emits?

1: Relevant warning in my case is: method stop in class Thread is deprecated: see corresponding Javadoc for more information. I am aware of the problems with stop however there are still some cases where due to legacy code we have to use it.

+8  A: 

No, and an enhancement request [1] for such a feature was closed as wontfix.

I agree it would be useful. I expect that the Scala core team aren't against the idea, but they have finite resources and many higher priorities.

[1] http://lampsvn.epfl.ch/trac/scala/ticket/1781

retronym
That request was for an `@unchecked` annotation. The OP is concerned with deprecation warnings rather than unsafe cast warnings.
Aaron Novstrup
You're right. A comment on the ticket did suggest @SuppressWarnings("unchecked") http://lampsvn.epfl.ch/trac/scala/ticket/1781#comment:3
retronym