I’ve noticed many are unpleased with this limit. There’s also some articles talking about it: https://underscore.io/blog/posts/2016/10/11/twenty-two.html
Is there a chance of discarding this limit?
I saw that the cause for this limit is the way Tuple and Function handles generics.
My first thought was maybe it could be bypassed by changing te way a Tuple works by having it built as a sort of collection which accepts AnyVal, and having Function’s arguments as a Tuple, but it may cause problems when you want to do the following, for example: declaring a List[Tuple[Int, String]], that is a List of Tuple which any of the Tuple objects is a 2-tuple which the first is an Int object and the second is a String object.
Another way to solve it I had in mind is to allow accepting a list of types in generic classes, instead of declaring Cls[T, U, V], add a support for a new sort of declaration Cls[3] (accept int instead of identifier), and refering to the types inside the class using [0], [1] and [2]. When needed an unbounded list of types define it as Cls[], and inside the class use [] to iterate over the types, and maybe add [_] or any other symbol like [length] to check the size of that list.
One advantage, is eliminating the need to name the types, which usually ends up with random letters, starting with T.
I suppose the only way to implement such a thing will be using reflection (holding list of class objects), which is not very efficient.