Open noresttherein opened 1 year ago
more minimal:
trait Base {
type U
def swap: Base
}
trait Sub extends Base {
override val swap: Sub { type U = Sub.this.U }
}
note that the override must be a val
, though
@noresttherein never rests. Nor does @SethTisue when minimizing.
I observe that no one begins by saying, "I don't wish to appear to be minimizing your problem, but..."
Sorry for not minimizing it. I mean, the type on the stack trace is an unapplied higher type, and I was so surprised by it being already so simple, because I was so sure I did it already countless times, and I kind of assumed it's already minimized.
Also, in case someone stumbles upon it, this works:
trait Base {
type U
type BaseSwap = Base { type U = Base.this.U }
val swap :BaseSwap
}
trait Sub extends Base {
type SubSwap = Sub { type U = Sub.this.U }
val swap :SubSwap
}
Which is probably the reason for my astonishment - I must have always been doing the above.
The most confusing part is that in the minimal version there are no typeParams
involved 🤔
Reproduction steps
Scala version: 2.13.10
Problem