Skip to content

Make case classes Serializable #5734

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

Merged
merged 2 commits into from
Jan 21, 2019

Conversation

OlivierBlanvillain
Copy link
Contributor

No description provided.

@OlivierBlanvillain
Copy link
Contributor Author

@nicolasstucki How do I regenerate these files:?

  • run/literals.decompiled
  • pos/i2104b.decompiled
  • pos/simpleCaseObject.decompiled
  • pos/simpleCaseClass-3.decompiled
  • pos/simpleCaseClass-2.decompiled
  • pos/simpleCaseClass-1.decompiled

@nicolasstucki
Copy link
Contributor

Run testFromTasty i2104b, it will generate pos/i2104b.decompiled.out.

@smarter
Copy link
Member

smarter commented Jan 18, 2019

We should really automatize this: in scalac, partest --update-check will automatically update all failing check files.

@OlivierBlanvillain
Copy link
Contributor Author

$ sbt "testFromTasty i2104b" && mv pos/i2104b.decompiled{.out,}
...
mv: cannot stat 'pos/i2104b.decompiled.out': No such file or directory

@smarter
Copy link
Member

smarter commented Jan 18, 2019

tests/pos instead of pos ?

@OlivierBlanvillain OlivierBlanvillain force-pushed the make-case-class-serializable branch 2 times, most recently from bab913e to 031440e Compare January 18, 2019 17:32
Test infrastructure taken from scala/scala#5278
@smarter smarter force-pushed the make-case-class-serializable branch from 031440e to c5dcbc6 Compare January 19, 2019 17:22
@smarter
Copy link
Member

smarter commented Jan 20, 2019

For some reason this PR broke the typeclass derivation tests, fixed by adding with Serializable in a few places but that doesn't seem optimal: 7705113 /cc @odersky

@smarter smarter merged commit b68a7ac into scala:master Jan 21, 2019
@liufengyun liufengyun deleted the make-case-class-serializable branch January 22, 2019 10:53
@liufengyun
Copy link
Contributor

Should we avoid adding Serializable if the case class already extends Serializable?

@smarter
Copy link
Member

smarter commented Jan 22, 2019

@liufengyun Yes, just like scalac we should allow explicitly extending Serializable or Product in a case class without error, can you create an issue for that ?

liufengyun added a commit to dotty-staging/scalatest that referenced this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants