|
|
|
|
|
by RyanCavanaugh
1070 days ago
|
|
Not to be flip, but if it were really all this easy, we would have done it already. There are dozens of questions you can throw at this code: What if the input's a union? What if it's a nested union -- how do you avoid combinatorial explosion? What if the input is a function -- how do you validate its parameter types using runtime information? What if the input is a conditional type? What if you're inside a generic function? The list is enormous and it quickly gets into "you've dug too deep and unleashed a Balrog" territory once you get beyond the primitives. |
|
I've got a fully functional compile-time dependency injection container that I've been sitting on for literal years because the transformer API isn't public.