Open trusktr opened 1 month ago
Ah, its because the mixin uses ConsumerElement
to cast the return type, which misses out on any type in the mixin class definition.
This can be fixed by allowing the return value to be the actual type returned. Instead of returning the ConsumerElement
definition, it can be merged into the base Class
type, then everything in the mixin class will propagate through the return value including ConsumerElement
.
Alternatively, we can write duplicate types in the ConsumerElement
type, but it can be error prone if the mixin class is changed but ConsumerElement
isn't.
Looks like the type defs might need an update (willing to help if I can circle back time willing). F.e.
this.contexts
is available, butthis.getContext()
is not: