Suppose I implement an extension with a context re...
# general-advice
a
Suppose I implement an extension with a context receiver like below, how do I access the
this
of the context receiver (instead of ClassA) to inspect its class attributes? I tried
this@foo::class.java
but there is no way to force the
this
to be of type
T
(context receiver)?
Copy code
context(T)
suspend fun <T : Any> ClassA.foo(parameter: ParameterA): Result<Unit> {
 .. how do I get the instance of T here to inspect its class attributes?
}