kevinmost
01/03/2018, 10:57 PMthis(...) invocation has to come first when invoking the constructor. You can use the invoke hack
data class GeoLocation... {
companion object {
@JvmStatic
@JvmName("fromString")
operator fun invoke(value: String) = value.split(" ").let { (lat, lng) -> GeoLocation(lat, lng) }
}
}