orangy
michaelrocks
12/22/2016, 9:39 PMcast
will always fail. The compiler won’t tell you about that.orangy
michaelrocks
12/22/2016, 9:40 PMlist.first().cast<Something>().let { actionOn(it) }
michaelrocks
12/22/2016, 9:42 PMmichaelrocks
12/22/2016, 9:42 PMorangy
michaelrocks
12/22/2016, 9:43 PMjw
12/22/2016, 9:44 PMmichaelrocks
12/22/2016, 9:44 PMmichaelrocks
12/22/2016, 9:46 PMorangy
orangy
val something = list.first() as Something
actionOn(something)
jw
12/22/2016, 9:48 PMjw
12/22/2016, 9:49 PMmichaelrocks
12/22/2016, 9:50 PMmichaelrocks
12/22/2016, 9:51 PMcast
and 82 usages of castOptional
orangy
orangy
orangy
voddan
12/23/2016, 5:59 AM(boo.foo as Int).qoo.zoo
is something desirable. If anything, we should add an intention to add parenthesises when needed: boo.foo as Int.<caret>
treelzebub
12/23/2016, 5:56 PMList.toMutableList()
exists, but Map.toHashMap()
does not?treelzebub
12/23/2016, 5:57 PMfun <K, V> Map<K, V>.toHashMap() = hashMapOf<K, V>().apply { putAll(this@toHashMap) }
jw
12/23/2016, 6:00 PMHashMap(this)
instead since it will pre-size the underlying structuretreelzebub
12/23/2016, 6:00 PMjw
12/23/2016, 6:00 PMtoMutableMap()
?jw
12/23/2016, 6:01 PMjw
12/23/2016, 6:01 PMtreelzebub
12/23/2016, 6:01 PMvoddan
01/03/2017, 8:19 AM