groostav
when
when(val something = whatever.propertyOrComputation()){ is ASomethingType -> something.propFromASomethingType //smart-casted for us }