gojuno / koptional

Minimalistic Optional type for Kotlin that tries to fit its null-safe type system as smooth as possible.
Apache License 2.0
289 stars 21 forks source link

Hide component1() destructuring from Java consumers #30

Closed radekkozak closed 6 years ago

radekkozak commented 6 years ago

I propose simple change that i think would be beneficial from the perspective of java consumers, namely annotating component1() function with kotlin's @JvmSynthetic

As 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 toNullable already so i don't see a point

Right now it looks like this:

koptional-in-java

artem-zinnatullin commented 6 years ago

This looks reasonable, but I need to do couple tests and read the spec carefully

artem-zinnatullin commented 6 years ago

cc @ming13 @dmitry-novikov @nostra13

radekkozak commented 6 years ago

Great. And the missing doc in kotlin's platform annotations - i noticed that this morning as well - so thanks for filling it in already

artem-zinnatullin commented 6 years ago

v1.6.0 was just released with this change https://github.com/gojuno/koptional/releases/tag/v1.6.0

Thanks for your contribution @radekkozak!

radekkozak commented 6 years ago

You got it ! And likewise thanks for the lib - like the minimalistic approach to things

Best from Poland for the crew