permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.22k stars 1.44k forks source link

Kotlin generation doesn't keep kotlin.collections.List<String> #599

Closed rishabh876 closed 4 years ago

rishabh876 commented 5 years ago

Overview

@NeedsPermission(Manifest.permission.CAMERA)
fun aFunction(option: kotlin.collections.List<String>) {
…
}

Expected

fun Activity.aFunctionWithPermissionCheck(option: kotlin.collections.List<String>) {
…
}

I expect both Kotlin List type.

Actual

fun Activity.aFunctionWithPermissionCheck(option: java.util.List<String>) {
…
}

Environment Which library version are you using? : 4.3.0

hotchemi commented 5 years ago

@rishabh876 Thx. This actually derives from KotlinPoet and we've added some similar workarounds. Would you mind send us PR?

https://github.com/permissions-dispatcher/PermissionsDispatcher/blob/3df06674b4232403bcc548eabca4b12bd9a5ffb8/processor/src/main/kotlin/permissions/dispatcher/processor/util/Extensions.kt#L124

cmoijulien commented 5 years ago

@hotchemi Can you re-open this issues. I have the same problem with the last release 4.5.0 Type mismatch: inferred type is java.util.List<String> but kotlin.collections.List<String> was expected

johngoren commented 4 years ago

Same here.

hotchemi commented 4 years ago

gonna take a look 🙇

hotchemi commented 4 years ago

I think this issue is addressed in 4.6.0.