A while ago the proposal was made replace inheriting multiple traits using
with with using
, . Partly because that is what other languages do. But mostly because
with was considered as a keyword for the new implicit system.
However the new implicit system seems to have settled on
given, so the last argument is not valid anymore. Also using a comma can be pretty confusing with tuples. The difference between a list of tuples and a list of items inheriting from two parents is much more difficult to distinguish.
trait A trait B // In Scala2 val myList: List[A with B] val myList2: List[(A, B)] // Currently in Dotty this looks more like a list containing an A and a B instead of a list of A with B val myList: List[A, B] val myList2: List[(A, B)]
Since Scala 3 seems to go towards using words instead of symbols (quite syntax,
end blocks with the new optional braces, and the recently proposed
as instead of
@), this seems less consistent (and IMO) more confusing. So I am in favor of keeping it as is.
I can’t find any topic in Contributors where this was actively discussed, if I have missed something feel free to close it (and point me to the actual discussion).