magnolia
magnolia copied to clipboard
[scala3] Add test for serializable generated type-class
Scala3 version of magnolia does not generate serializable typeclass when defined inside a non-serializable outer, unlike the scala 2 version. Tested in https://github.com/softwaremill/magnolia/pull/498.
It looks like the summonInline[Typeclass[p]] lambda in the CallByNeed takes a reference on the outer obejct.
@adamw since you reviewed https://github.com/softwaremill/magnolia/pull/498
This new test is only relevant for JVM, and fails for JS and native. The project layout for magnolia looks non standard. I don't know how to add JVM only test.
Would migrating to sbt-corssproject be considered ? I can submit a PR for that.
@RustedBones our projects use https://github.com/sbt/sbt-projectmatrix, in my experience this is the only sane way to maintain projects with both simple & complex cross-platform setups. I think adding the test in scalajvm would do the trick (as opposed to scala), see e.g. here.
Ok, let's stick with sbt-projectmatrix.
At the moment, there isn't a scala folder. The project defines fake project root and overrides the scalaSource. (btw, this setup does not work well with intelliJ and requires to manually add source to get indexer working).
What about standardizing the project layout like this and create a scalajvm source folder in the test project ?
Any take on this one? There is probably a trick to avoid this but I couldn't find any other alternative