Spot the bug in delivery state labeling

from Sealed classes and interfaces
Kotlin 2.4.10 intermediate 4 min 1 issue to find

Every delivery state needs an explicit label. Find the line that defeats compile-time checking.

kotlin
sealed interface DeliveryState {
    data object Queued : DeliveryState
    data object Sent : DeliveryState
    data class Failed(val reason: String) : DeliveryState
}

fun label(state: DeliveryState): String = when (state) {
    DeliveryState.Queued -> "queued"
    DeliveryState.Sent -> "sent"
    else -> "unknown"
}

fun main() {
    println(label(DeliveryState.Failed("offline")))
}
Open in playground
Report an error