I have a custom function for wrapping Service api call
I want to add some warning while some api call forget adding safeApiCall{}
suspend fun <T:Any> safeApiCall(
apiCall: suspend () -> T
) {
//do something
}
interface Service {
@Get
suspend fun getUser() : User
@Put
suspend fun updateUser(name:String) : User
}
val service:Service
service.getUser() //warning "should use safeApiCall"
SafeApiCall { service.getUser() } //ok
This is my attempt , but not working
interface $Interface$ {
suspend fun $Method$ ($Parameter$ : $ParameterType$): $ReturnType$
}
$Interface$.$MethodCall$