Scala 3 - type parameters and type members

#1

There was mention in the past about some form of unification between type parameters and type members in Scala 3, as a means to simplify the language. I have not seen any recent mentions about this effort, nor does it seem featured in the Scala 3 roadmap.

I’m just wondering if this is still an ongoing research or whether it is something that was abandoned or turned out to be impractical, unsound or otherwise undesirable.

Thank you.

(Sorry, I looked for a reference to this effort but came up short with Google; I believe this was previously covered in one of Martin’s talks about Scala 3 / Dotty.)

3 Likes
#2

Hello, type parameters are indeed encoded as abstract type members (with name mangling), you can read more in this paper:

http://guillaume.martres.me/publications/dotty-hk.pdf,

Although this may be out of date again

#3

We went back having type parameters as first class feature. We learned a lot trying to do the encoding but in the end it was too brittle and too hard to make 100% backwards compatible, so we abandoned the effort.

7 Likes