shine icon indicating copy to clipboard operation
shine copied to clipboard

Preparation for Scala 3 migration

Open michel-steuwer opened this issue 3 years ago • 0 comments

This PR introduces changes that will help to ease the migration to Scala 3, but the code in this PR remains valid Scala 2 code.

In detail the changes are:

  • The type () is replaced with Unit (as Scala 3 seems to no longer accept () as a type)
  • The use of generic type projections (i.e. T#U) in the FunctionHelper class is avoided as these have been dropped in Scala 3
  • The ._1 and ._2 notations on Rise and DPIA expressions do not work in Scala 3 (I don't know why) I have replaced them with `1` and `2`
  • The `_` notation is also not accepted by Scala 3, I have replaced it with `__`
  • Returning anonymous object types (i.e. `def foo() = new Object { ... } has changed somehow and I have avoided this now altogether by giving the returned type names. This was mainly used in the DSLs.
  • I accommodated a change in the signature of the unapply method generated for case classes.
  • I removed some syntax that used Unicode symbols. This is not related to Scala 3 but has repeatedly led to problems to compile on systems where the file system does not support Unicode (as Scala generates a file with the class name for each class).

michel-steuwer avatar Aug 13 '21 15:08 michel-steuwer