The term could be generic parameterization.
This is the moment that is defined which generic terms will be used in the composition of the method, this is where generic parameters are being defined (not to be confused with parameters of the method itself). Remember that genericity is just a way to parameterize something, so there is something that works as super variables in the code that will be exchanged for the value (a type) at the time of the call. This part defines what will be used.
In fact you are correct that the type of return is already the SimpleStepBuilder<I, O>
who uses the I
and O
to generalize the type that will be effectively used in the method call (instantiating that class SimpleStepBuilder
parameterizing two types in it. This part consumes the definition created before.
In general it is easier for the compiler to know the definition before, but it is less intuitive to read because in consumption the generic argument will be elsewhere.
In C# it would be more intuitive:
public SimpleStepBuilder<I, O> chunk<I, O>(int chunkSize) => new SimpleStepBuilder<I, O>(this).chunk(chunkSize);
I put in the Github for future reference.
That term is for something else.
– Maniero
There is no easy and well-defined term about it, but I put in my answer what it is, the one you put has to do with the subject, but it is for something far more sophisticated than that, this code has no restriction (bounded).
– Maniero