In Kotlin, why is it not able to pick from these functions based on the return type of the suspend function? Apart from providing different function names, which I really don't want to do, what are the alternatives?
@JvmName("hasPermission1")
suspend fun <T> hasPermission(requiredPermissions: String, block: suspend () -> T): DataFetcherResult<T> {
println("todo check permissions: $requiredPermissions")
return failureResult(
Unauthorized()
)
}
suspend fun <T> hasPermission(requiredPermissions: String, block: suspend () -> DataFetcherResult<T>): DataFetcherResult<T> {
return failureResult(
Unauthorized()
)
}