-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
remove Serializable from types inferred across companions #1162
Conversation
eae4fb8
to
f7ad770
Compare
@thesamet I verified that this is solving my use-case (no wartremover Serializable error on an inferred type when constructing a I explored the idea of adding the wartremover compiler plugin to the |
The traits changes in this PR are used to extend |
Of course, I should have done that from the beginning.
|
I am not sure when it comes from, but it's definitely there:
|
I think that in this case, since it is unexpected to have |
@@ -67,7 +67,7 @@ trait GeneratedOneof extends Any with Product with Serializable { | |||
def valueOption: Option[ValueType] = if (isDefined) Some(value) else None | |||
} | |||
|
|||
trait GeneratedOneofCompanion | |||
trait GeneratedOneofCompanion extends Serializable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not seem to be used anymore (so the addition is useless), should it be deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Looks like it has never been used. Let's mark it as deprecated.
I had a look with Scala 2.12: |
Serializable is added to companion objects when the class itself extends Serializable.
Huh, interesting! Thanks for investigating this. I didn't know scalac was doing that. |
Follows #984, which was not enough for the previous use-case.
On master: