Permissionsdispatcher: Kotlin generation doesn't keep types of Array or ArrayList

Created on 10 Jan 2018  Â·  4Comments  Â·  Source: permissions-dispatcher/PermissionsDispatcher

Overview

@NeedsPermission(Manifest.permission.CAMERA)
- fun aFunction(option: Array<out String>) {
…
}

Expected

fun Activity.aFunctionWithPermissionCheck(option: Array<out String>) {
…
}

I expect both Kotlin String type and out modifier to be kept.

Actual

fun Activity.aFunctionWithPermissionCheck(option: Array<java.lang.String>) {
…
}

Note that Any is translated to java.lang.Object too (probably same problem)

Same behavior with ArrayList<String>

Environment

  • Which library version are you using? : 3.1.0
bug contributionwelcome

Most helpful comment

@vincentnock thx! we gotta fix the problem...our implementation relies on https://github.com/square/kotlinpoet and it might cause the thing 🤔

All 4 comments

@vincentnock thx! we gotta fix the problem...our implementation relies on https://github.com/square/kotlinpoet and it might cause the thing 🤔

Maybe related to this issue ?
https://github.com/square/kotlinpoet/issues/86

You can test with 4.0.0 snapshot! thank you for your heads up.

Was this page helpful?
0 / 5 - 0 ratings