Permissionsdispatcher: nullable params with Kotlin

Created on 19 Oct 2017  路  1Comment  路  Source: permissions-dispatcher/PermissionsDispatcher

Overview

When the function annotated with @NeedsPermission has a nullable parameter, the generated function in the dispatcher have a non nullable one instead.

Expected

The **WithPermissionCheck generated method should use a nullable parameter too

Actual

The **WithPermissionCheck use a non-nullable parameter

Environment

  • v3.0.1

Reproducible steps

//Function in Activity
@NeedsPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
internal fun functionWithNullableParameter(string: String?) {
    //...
}

//Generated function in the PermissionsDispatcher
fun HomeActivity.functionWithNullableParameterWithPermissionCheck(string: String) {
    //...
}

bug

Most helpful comment

Thanks for reporting! Yeah, we should obey the nullability of parameters given to permission-protected methods.

>All comments

Thanks for reporting! Yeah, we should obey the nullability of parameters given to permission-protected methods.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alex-ZHOU picture Alex-ZHOU  路  6Comments

fanmingyi picture fanmingyi  路  3Comments

herbertdai picture herbertdai  路  7Comments

rckahale picture rckahale  路  5Comments

silverAndroid picture silverAndroid  路  4Comments