Sharing parts of case classes

For the record (no pun intended), there is couple of links relevant to the discussion and having proper record types in dotty:

The most recent (AFAIK) work on records for scala can be seen in this ICFP presentations: https://www.youtube.com/watch?v=ntrSagXL200
which is based on this paper: http://www.csc.kth.se/~phaller/doc/karlsson-haller18-scala.pdf

This implementation adds full features records to dotty. I have no idea if authors are reading this forum or if they are in contact with EPFL but it would be really nice to have this extension in dotty.

There is also some older threads/discussions here:


and what is currently available (and is a base for work from first links): https://dotty.epfl.ch/docs/reference/changed/structural-types.html

And I have looked at
shapeless records and scala-records but neither of them is adopted or highly usable (you can see why in the first presentation, which also compares them).

2 Likes