iex
07/15/2017, 1:10 PMdiesieben07
07/15/2017, 1:11 PMmyObj.asMyEnum()?.let { ... } ?: myObj.asMyOtherEnum()?.let { }
would work.iex
07/15/2017, 1:11 PMiex
07/15/2017, 1:12 PMwhen
for example?diesieben07
07/15/2017, 1:12 PM...
blocks identical?iex
07/15/2017, 1:12 PMdiesieben07
07/15/2017, 1:13 PMiex
07/15/2017, 1:13 PMdiesieben07
07/15/2017, 1:14 PMval myRes = (myObj.asMyEnum() ?: myObj.asMyOtherEnum())?.computeRes()
iex
07/15/2017, 1:14 PMcomputeRes()
iex
07/15/2017, 1:14 PMdiesieben07
07/15/2017, 1:14 PMcomputeRes
is a member function on the enum.diesieben07
07/15/2017, 1:15 PMcomputeRes
.iex
07/15/2017, 1:15 PMiex
07/15/2017, 1:16 PMiex
07/15/2017, 1:16 PMiex
07/15/2017, 1:17 PM?:
to join the let
blocks isn’t that bad actually, will keep that. Thanks for your help anyway 🙂rogeralsing
07/15/2017, 1:34 PMval msg = context.message
when (msg) {
or do I need to do this always for smart casts?orangy
rogeralsing
07/15/2017, 6:24 PMorangy
karelpeeters
07/15/2017, 6:32 PMrocketraman
07/15/2017, 6:33 PMxfuncname
diff setting for git to show kotlin class/fun/object names in diff hunk headings?rogeralsing
07/15/2017, 6:41 PMorangy
redrield
07/16/2017, 11:53 PMredrield
07/16/2017, 11:53 PMredrield
07/16/2017, 11:54 PMredrield
07/16/2017, 11:54 PMredrield
07/16/2017, 11:54 PM