by yarg · 3y ago · 0 comments
There's a bit of unnecessary overhead in having to externally declare and import the return type.
public [K key, V value] getElement(int index);
This really comes down to the dynamic vs typed argument, and to me the answer is "minimise the boiler-plate, maximise the guarantees.".But I wouldn't expect that to be the common use case - I'd generally expect that the caller would just be implicitly importing and using the type effectively declared in the method header.