hi all, given this function ```inline fun <reif...
# announcements
g
hi all, given this function
Copy code
inline fun <reified T> proxy() = (something...) as T
I can use use as
val proxy = proxy<MyClass>()
- but how can I use it from an interface to obtain a proxy of a class implementing this interface?
To give you some context, I would like to provide an interface providing a DSL syntax
async{ myMethod() }
where myMethod is a method of the class implementing the interface, and I would like to inject a scope which is a proxy of the current class in such a way that
myMethod()
call is proxied to change its behavior (I hope it's clear!)
z
AFAIK there is no kotlin solution to this. Java has the ability to create reflection-based proxies, so if you're only targeting the JVM you could do that.