Paul Woitaschek
03/28/2019, 6:45 AMgildor
03/28/2019, 6:52 AMwhen
is expression, you can force thisgildor
03/28/2019, 6:53 AMPaul Woitaschek
03/28/2019, 7:02 AMPaul Woitaschek
03/28/2019, 7:05 AMPaul Woitaschek
03/28/2019, 7:06 AMgildor
03/28/2019, 7:06 AMgildor
03/28/2019, 7:06 AMPaul Woitaschek
03/28/2019, 7:06 AMgildor
03/28/2019, 7:06 AMgildor
03/28/2019, 7:07 AMPaul Woitaschek
03/28/2019, 7:36 AMPaul Woitaschek
03/28/2019, 7:36 AMShawn
03/28/2019, 8:53 AMwhen
without necessarily writing their code such that it results in an assignment -
fun Any?.exhaustive() = Unit
when (sealedInstance) {
...
}.exhaustive()
not exactly the most elegant solution, but one nonethelessgildor
03/28/2019, 8:55 AM.javaClass
as suggested someone in sealed when issue, Any?.exhaustive()
pollutes autocompleteShawn
03/28/2019, 9:01 AMAny?
, so “pollution” seems like a strong word for literally one method. I agree it’d be nice to have this as a smarter language feature, but I personally don’t see that much issue with .exhaustive()
gildor
03/28/2019, 9:01 AMgildor
03/28/2019, 9:01 AMgildor
03/28/2019, 9:02 AMso “pollution” seems like a strong word for literallyYou will have this extension on any type, I would say that this is pollution
glenkpeterson
03/28/2019, 1:31 PMPaul Woitaschek
03/28/2019, 2:23 PM