Попробуйте использовать делегатов. Это простой класс:
class ReadOnlyDelegate<R, T>(val t:T) : ReadOnlyProperty<R, T> {
override fun getValue(thisRef: R, property: KProperty<*>) = t
}
Используйте его следующим образом:
data class CurrentWeatherResponse(
// Tells GSON that the "currently" field of the JSON returned by the
// API should be tied with our CurrentWeatherEntry data class
@SerializedName("currently")
val currentWeatherEntry: CurrentWeatherEntry,
val latitude:Double,
val longitude:Double,
val timezone:String) {
val location:WeatherLocation by ReadOnlyDelegate(WeatherLocation(latitude, longitude, timezone, currentWeatherEntry.time))
}