Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullable params have wrong type with Kotlin #603

Closed
m-i-k-e-e opened this issue Mar 26, 2019 · 4 comments
Closed

Nullable params have wrong type with Kotlin #603

m-i-k-e-e opened this issue Mar 26, 2019 · 4 comments
Labels
Milestone

Comments

@m-i-k-e-e
Copy link

m-i-k-e-e commented Mar 26, 2019

FAQs


Overview

Hello,

It looks like Nullable Double parameters are wrongly resolved.

Expected

Parameters to be resolved as kotlin.Double?

fun setupMap(zoomLevel: Double, latitude: Double?, longitude: Double)
fun TrackedMapFragment.setupMapWithPermissionCheck( zoomLevel: Double,latitude: Double?, longitude: Double)

Actual

Parameters are resolved as java.lang.Double?

fun setupMap(zoomLevel: Double, latitude: Double?, longitude: Double)
fun TrackedMapFragment.setupMapWithPermissionCheck( zoomLevel: Double, latitude: java.lang.Double?, longitude: Double )

Environment

kapt "org.permissionsdispatcher:permissionsdispatcher-processor:4.3.0"
implementation 'org.permissionsdispatcher:permissionsdispatcher:4.3.0'

@hotchemi
Copy link
Member

Thx for your report. Can I suppose the problem here is Double? is converted to java.lang.Double?, am I correct?

@m-i-k-e-e
Copy link
Author

Exactly. It creates errors at compile time as for some reasons, Kotlin.Double is not the same as Java.lang.Double.
But it only happens with nullable values

@hotchemi
Copy link
Member

I see. I think this is due to KotlinPoet.. 🤔

@alifhasnain
Copy link

Still having an issue with nullable Long type. Generated code is using java.lang.Long instead of kotlin.Long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants