Closed shiehnpin closed 5 years ago
This might be related to KotlinPoet again
Just like issue #427 ?
I've updated KotlinPoet to 1.0.0-RC1
Updated kotlinpoet to 1.0.0 but the issue hasn't been addressed🤔
@shiehnpin this issue is from KotlinPoet but in this case you should annotate argument f
with NeedsPermission right?
let me close the issue since it's been a long time since opened.
This issue still persists when trying to use functions as parameters. As a workaround I defined a new class containing my callback functions and passed this class as the parameter:
class LocationCallbacks(
val success: () -> Unit,
val error: () -> Unit,
)
@NeedsPermission(Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION)
fun locationAction(callbacks: LocationCallbacks) {}
FAQs
Overview
Expected
Successfully rebuild and generate code to be invoked like this:
Actual
I can't rebuild project and get following error:
Type mismatch: inferred type is kotlin.jvm.functions.Function0<Unit> but () -> Unit was expected
Environment
4.0.0-alpha