is there a way to get access to a delegated object...
# getting-started
k
is there a way to get access to a delegated object w/o reflection? i.e. suppose i want
Copy code
class A : B by C() {
	// need to set a variable in the object C() returned

}
Options I know of: 1) pass in a C instance to the constructor of A with a default, but this leaks implementation details to the API 2) use
A::class.java.getDeclaredField("\$\$delegate_0")
, but thats a mess and probably not reliable in the future 3) I could easily solve this issue using inheritance, but conceptually inheritance doesnt make sense for my problem, delegation does