I don’t see that it throws an exception explicitly...
# build-tools
a
I don’t see that it throws an exception explicitly:
Copy code
LOOKUPSWITCH
      1: L2
      2: L3
      default: L4
1) In case if I use
when
as expression it generates return
Unit
which can result in
ClassCastException
Copy code
L4
    GETSTATIC kotlin/Unit.INSTANCE : Lkotlin/Unit;
2) In case if I user
when
as execution block it generates just no-op code (return in my case because I have nothing after it)
Copy code
L4
    LINENUMBER 56 L4
    RETURN