1

Say I see this:

object ThingA extends OtherThingA[ThingB, ThingA] {...

and this:

trait OtherThingA[B, A <: LastThing[B]] extends ...

What is this doing exactly?

Here is what I understand:

  • ThingA is using the trait OtherThing and so has to implement the trait's methods or it now has access to the concrete public members.

I guess when we actually extends OtherThingA, we're extending it and declaring the types of it too which are ThingB and ThingA?

Jwan622
  • 11,015
  • 21
  • 88
  • 181
  • What is `LastThing`? – Yuval Itzchakov Jun 05 '18 at 16:00
  • It doesn't make any sense. `LastThing` should be `OtherThingA`. Then it's a duplicate of any other "What is F-bounded polymorphism" question. – Andrey Tyukin Jun 05 '18 at 16:12
  • @YuvalItzchakov Note that I didn't claim that OP *has* F-bounded-poly in his question. I only said that the code doesn't seem to compile as-is, and that replacing `LastThing` by `OtherThingA` seemed like the shortest way to make it compile. It was not a request to close, but rather to clarify the question (which *might* become a duplicate if it turns out to be yet another generic question about f-bounded poly). – Andrey Tyukin Jun 05 '18 at 16:31
  • It looks to me like OP is asking about 1) F-Bounded polymorphism 2) Upper Type Bound. I think he can get his answer from the duplicate. If not, I'll re-open. – Yuval Itzchakov Jun 05 '18 at 16:32

0 Answers0