I'm interested in making a simple KEEP-87 inspired...
# arrow-meta
b
I'm interested in making a simple KEEP-87 inspired implicit dependency injection plugin, but I'm not sure where to start Basically, if a primary constructor is called with missing parameters, any parameters marked with @Dependency will be filled in with variables in the environment of the same type, that are also marked with @Dependency. (Example attached) I tried playing around with irConstructorCall, but couldn't get that to be called (will I have to wait for Kotlin 1.4 for IR?). And from there, I'm not sure how to transform the constructor call to find missing arguments, or how to find variables I can use
r
Not trying to discourage you but this feature is coming up soon in Arrow via @Given which is used both by providers and injections
It’s not constrained by constructors, it supports class, fun, val and object and you can inject in any expression position not just setter and constructors
It’s basically implicits without being constrained by type args unlike type classes and like dagger or scala but they are coherent in resolution not scoped
b
Oh cool! I'll probably end up using that then. Thank you! :)
👍 1