Make Gen[Tuple] serializable and add regression test - #672
Conversation
|
@yhylord It looks like these instances are serializable on 2.13 but are not serializable on 2.11 or 2.12 on the JVM. (We're not running these tests on the JS platform which is why that's OK.) The change does seem to help 2.13; it's possible for 2.11 and 2.12 that we'd need to create our own serializable |
|
@yhylord You can choose to build/test Scala 2.12.10 (instead of 2.13) by running The command is stateful so it will last until you restart SBT. You can use different Scala versions there (e.g. 2.11.12 to test on 2.11 as well). |
|
Rebased & merged in #795. |
|
To be honest, the commit in #795 did credit Haoyang Yu, but it was slightly modified from the original. |
|
The discussion of tuple serialization above last year suggested that this would work on 2.13, but not 2.12. I couldn't find that to be the case. I took the change made here and added some test cases to the existing serialization suite and created #795. It worked fine for both Scala versions on the JVM, fwiw. I'm not sure what changed since last year. It's not clear what's different about |
Right now, tuple generators (e.g.
Gen[(String, Int)]) are not serializable. Generated functions that have tuples in the result (e.g.List[Int] => List[(String, Int)]) also don't serialize.This PR adds serializability to the mentioned values. It does so by removing
Function1which is not serializable and useflatMapandmapto generatezipcode incodegen.scala. A serialization regression test is also included.