Hide component1() destructuring from Java consumers#30
Merged
artem-zinnatullin merged 1 commit intogojuno:masterfrom Jul 31, 2018
Merged
Conversation
Refine library's interop by hiding destructuring operator from Java consumers
Contributor
|
This looks reasonable, but I need to do couple tests and read the spec carefully |
artem-zinnatullin
approved these changes
Jul 31, 2018
Contributor
Contributor
Author
|
Great. And the missing doc in kotlin's platform annotations - i noticed that this morning as well - so thanks for filling it in already |
arturdryomov
approved these changes
Jul 31, 2018
Member
arturdryomov
left a comment
There was a problem hiding this comment.
Seems to be a pretty good thing, thanks!
nostra13
approved these changes
Jul 31, 2018
Contributor
|
v1.6.0 was just released with this change https://github.com/gojuno/koptional/releases/tag/v1.6.0 Thanks for your contribution @radekkozak! |
Contributor
Author
|
You got it ! And likewise thanks for the lib - like the minimalistic approach to things Best from Poland for the crew |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I propose simple change that i think would be beneficial from the perspective of java consumers, namely annotating
component1()function with kotlin's@JvmSyntheticAs a consequence method will become invisible from Java. Long story short i think it's rather unneccesary to pollute java with a method that quite frankly doesn't say anything for them as the concept of kotlin's destructuring is simply not there. For getting actual values there is
toNullablealready so i don't see a pointRight now it looks like this: