Ruckus
04/30/2018, 4:52 PM// Something like this, but please not exactly like this
operator fun ObservableInt.cast(Int::class) = get()
operator fun ObservableInt.cast(Double::class) = get().toDouble()
...
fun updateGrid(rows: Int, cols: Int) { ... }
fun updateBounds(width: Double, height: Double) { ... }
...
val rows: ObservableInt = ...
val cols: ObservableInt = ...
val width: ObservableInt = ...
val height: ObservableInt = ...
...
updateGrid(rows as Int, cols as Int)
updateBounds(width as Double, height as Double)
Not that the cast is still explicit (requiring as
). I really do NOT want implicit casts.