Adriaan Moors
Adriaan Moors
> I'm convinced that this trap shouldn't exist in Scala in the first place, though. Me too: https://github.com/scala/scala-dev/issues/441
(one of the motivations for https://github.com/scala/scala-dev/issues/601)
i don't follow entirely, but think of a trait extending a class as a downsteam obligation for any classes extending that trait (same as with a self type) -- the...
so, any instance of the trait will also be an instance of its declared superclass
Agreed -- again, the surprise element is why I think we should get rid of it, but I guess I should argue that over at the other ticket :-)
That's why a `@PureInterface` annotation would be useful: the compiler could check that your trait doesn't have any of this baggage.
We currently have no plans to implement this. Since this involves a language change, it would require a [SIP](https://docs.scala-lang.org/sips/sip-submission.html).
uncommenting that quick fix (this is performance critical, so we can't just use `=:=`), you get the (expected) type error: ``` type mismatch; found : K[Int] required: K[_ >: String]...
Whoops -- I guess I was thinking in immutable maps, or just being confused as usual 😊