Extending typeclass defined parametrically from typeclass defined using Self type member

I’m not sure if this question belongs in this forum or in users.scal-lang.org, so I apologise in advance if this is posted in the wrong place. My question regards the new typeclass syntax introduced with the experimental.modularity feature set.

I want to define a typeclass Lattice { type Self }, which ought to extend the already existing PartialOrdering[T] typeclass. I’m really enjoying the new Self member type syntax, and am using it throughout my project. Is there anyway I can define Lattice using the new syntax, and still extend PartialOrdering[T]? Something akin to trait Lattice extends PartialOrdering[this.Self]?

Welcome, it probably belongs in the Users forum. Worry not, the people who can answer it (the compiler people + expert users) usually check both forums, though Users forum could get you more eyeballs on your question.

Thank you! I will try my luck there

1 Like