Difficult Trait Conformance
I have been using mojo nightly
mojo 2024.8.305 (f99b2e40). I need someone's help on why this doesn't work:
When running:
It keeps saying ListDatapipe doesnt conform to IterDataPipable. I've tried a bunch of different ways of trying to make this work, but none of them work well.
I'm trying to get a generic IterDataPipable working so I can chain. Tried getting help from https://discordapp.com/channels/1087530497313357884/1269718914208759870 kapa. I'm convinced its an issue with https://github.com/modularml/mojo/issues/32153 Replies
Might not be implementable except by moving
[T: CollectionElement] parameter from ListDatapipe to every function of ListDatapipe, but you still run into the issue with var src: List[T]
definitely something that needs parameterizable traits to make this easy
My mojo -v is 24.4, so ref[_] doesn't parse for me yet, feel free to add it back in:
I made __next__ in the trait take an inout self, copied the parameters onto __next__ impl, and then made that one inout self as well since it mutates self.index
and then also removed the [T] from the required traitsI still get:
Yeah sounds like parameterizable traits will be needed to make this actually work, but I appreciate the response!
oh i see, because the
T in __next__ may not necessarily be the same T as the one from ListDatapipe
yeah, this 100% needs parameterized traits, no way around it