``` when (debitEntry) { is AccountUnpaid -> ...
# language-proposals
o
Copy code
when (debitEntry) {
   is AccountUnpaid -> when {
      debitEntry.sources.isEmpty() -> resubmitEntry(debitEntry)
      debitEntry.sources.singleOrNull() in validSources -> total += quantity
   }
   is Deprectation -> { total += debitEntry.quantity; depreciation += debitEntry.quantity }
}