Unfortunately, as of API version 26, SFDC removed parameterized interfaces.
However, it is relatively easy to create new interfaces and set the version as 25.
So, to take the example from Parameterized Interfaces - what are they?, I can make the Pair and DoubleUp interfaces, as "version 25", but then I can make the StringPair itself as "version 38" (for example).
The StringPair compiles and functions as expected.
While one might argue that this would not be idiomatic Apex and that newer developers might not be able to find documentation to support it (if they don't use stackechange, but who doesn't?), I'm wondering from a technical perspective, what problems should I expect?
- Do issues related to instanceof also effect Parameterized types?
- Are there performance problems?
- Are there known compatibility issues when such interfaces might be come into contact with newer features or objects/sObjects which are dependent upon newer features?
To be clear, I'm not suggesting putting all the code or any other code into older API versions, just specifically the parameterized interfaces.