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

kt_jvm_import doesn't import all of a library's methods #56

Closed
velipso opened this issue Apr 26, 2018 · 1 comment
Closed

kt_jvm_import doesn't import all of a library's methods #56

velipso opened this issue Apr 26, 2018 · 1 comment

Comments

@velipso
Copy link

velipso commented Apr 26, 2018

I suspect this is a larger issue, but the current kt_jvm_import fails to import all of Arrow's methods.

I've published a minimal test case here:

https://github.com/Bakpax/bazel-arrow-kt

As far as I can tell, some of Arrow's methods are obscured behind typealias and an annotation (@higherkind). I can see that rules_kotlin will process annotations with kapt, but I think this information is lost somehow during a kt_jvm_import.

It would be great if there was a simple fix for this, but if there isn't, it would also be useful to know if/when this issue will get resolved, so we can plan accordingly.

Thanks for your help, we use rules_kotlin for all our kotlin code 😃.

@velipso
Copy link
Author

velipso commented Apr 26, 2018

I found the answer, strangely (to me).

The flatMap function is available via import arrow.core.flatMap, even though it is applied to an Either object.

import arrow.core.flatMap

...

val right = Either.Right(5)
right.flatMap { Either.Right(it + 6) }

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

No branches or pull requests

1 participant