3 ms·
I still don't quite understand the generics magic required in order to not generate exponential amounts of code for it to allow random order of arguments, but I
by MrBuddyCasino 6y ago
I still don't quite understand the generics magic required in order to not generate exponential amounts of code for it to allow random order of arguments, but I won't complain.
That capability would have come in handy on Java/Lombok.
- swsieber 6y ago> exponential amounts of code for it to allow random order of arguments The key is that it only generates code for types that actually get used. So if you always call the orders in the same order, it won't generate tons of code. That said, you could actually tweak the type-safe builder to enforce a certain order for calling the methods on the builder. Also, it's not the order of arguments, it's the order of method calls :)