123
02/24/2021, 2:24 PM`companion object {
val SORTING_COLUMNS = mapOf(X to "Y")
val DEFAULT_SORTING_COLUMN: String = SORTING_COLUMNS[X]!!
}`
Anything I could do here to avoid reductant !!
?wbertan
02/24/2021, 2:27 PMSORTING_COLUMNS.getValue(X)
?123
02/24/2021, 2:28 PMVampire
02/24/2021, 2:30 PM[X]
translates to .get(X)
wich returns T?
and the compile cannot know what is insider your map. mapOf
could also return a map that returns a value on even seconds and null
on odd seconds.
So only with getValue
, yep 🙂Nir
02/24/2021, 3:13 PM