I have the following code inside a .kt file:
sealed interface Animal {
val name: String
}
data class SeaLion(override val name: String) : Animal
fun <T: Animal>manage(value: T) {
when (value) {
}
}
For some reason, the when block doesn’t display the expected compile time warning:
‘when’ expression must be exhaustive. Add the ‘is SeaLion’ branch or an ‘else’ branch.
However, if I change the file extension to .kts, it does display the warning. What exactly is going on here?