Hi! I am coming from the C++ world, is there a way to declare an implicit constructor or an implicit casting operator?
I mean, I want to publish on my API a function which takes 3 arguments and two of them can come as a Long or as an instance of an object which can be instantiated given a Long. Is there a way to avoid publishing the overloads for all posible combinations?
🇳🇴 1
s
Shawn
05/13/2019, 2:10 PM
Generally speaking, Kotlin takes the approach that explicit is better than implicit
Either you place the onus of converting that Long to whatever format it needs to be in on the caller or you publish an API that includes both signatures