storio icon indicating copy to clipboard operation
storio copied to clipboard

Method name collision with kotlin reserved word

Open omainegra opened this issue 8 years ago • 5 comments

Methods Prepared*.object have collision with kotlin object reserved word. It's kind of ugly be calling this way

storIOSQLite.delete().object(toDelete)

omainegra avatar Apr 08 '16 23:04 omainegra

@artem-zinnatullin what do you think about adding alias method for object for better experience in Kotlin?

geralt-encore avatar Jul 21 '16 19:07 geralt-encore

I'd just add extension function in the project that uses StorIO :)

On Thu, 21 Jul 2016, 22:48 Ilya Zorin, [email protected] wrote:

@artem-zinnatullin https://github.com/artem-zinnatullin what do you think about adding alias method for object for better experience in Kotlin?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pushtorefresh/storio/issues/638#issuecomment-234363358, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7B3EuC9cil4R2Htc7SgPEBO_-OGEghks5qX80ngaJpZM4IDdRg .

artem-zinnatullin avatar Jul 21 '16 21:07 artem-zinnatullin

Ok, since Kotlin is now an official Android language we need to actually resolve this in 2.0.0

artem-zinnatullin avatar May 18 '17 00:05 artem-zinnatullin

@artem-zinnatullin could you provide example of that extension function, please?

KChernenko avatar Jun 02 '17 13:06 KChernenko

Something like this should work:

fun <T> PreparedGetObject.Builder<T>.kobject(type: Class<T>) = this.`object(type)`

artem-zinnatullin avatar Jun 08 '17 22:06 artem-zinnatullin