Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to deprecate case class methods #8685

Closed
scabug opened this issue Jun 27, 2014 · 2 comments
Closed

Make it possible to deprecate case class methods #8685

scabug opened this issue Jun 27, 2014 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jun 27, 2014

We'd like to eventually make something that was a case class a trait. So we'd like to be able to deprecate at least some of the methods that case classes generate.

In our case, the only important method to deprecate is the constructor - there's no reason to use the extractor or copy methods on this particular class, but the constructor is definitely used. So our specific problem would be solved if doing this:

case class Foo @deprecated(...) (bar: String)

resulted in the Foo.apply method being deprecated. More generally it would also be nice to be able to deprecate the unapply and copy methods. Currently it seems the only way to deprecate any of these methods is to manually implement the entire case class, and then apply the @deprecated annotation to the methods.

@scabug
Copy link
Author

scabug commented Jun 27, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8685?orig=1
Reporter: @jroper

@scabug
Copy link
Author

scabug commented Jan 17, 2017

@som-snytt said:
For the narrow use case, where the constructor is deprecated and the apply is rewritten to call it.

scala/scala#5646

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants