fun main(x1: Double?, range: ClosedRange) { when (x1) { null -> throw Exception() in range -> {} // error, no smartcast from previous branch, OK in OI } when { x1 == null -> throw Exception() x1 in range -> {} } }