4 ms·
Uh, how would such an interface look? The one that can be implemented in two ways, and yet "the required type means there's only one implementation that could w
by Joker_vD 5y ago
Uh, how would such an interface look? The one that can be implemented in two ways, and yet "the required type means there's only one implementation that could work"?
- lmm 5y agoI'm mainly thinking of parameterized interfaces, like `Comparable` or some kind of "Keyed<T>". Another example would be datastructures that can be iterated in multiple ways, e.g. a multidimensional array that can implement both `Iterable<Int>` and `Iterable<Row<Int>>` or something like that. You could have cases where you're passing that to a function that expects Iterable<Int> so it's obvious which implementation you want, and cases where you would have to disambiguate.