kotlin-language-server
kotlin-language-server copied to clipboard
Smart Casts
Currently, the language server does not seem to respect smart casts.
fun test() {
class Test() {
var qwe: Int = 5
}
val asd = Test()
val fgh = asd as Any
if (fgh !is Test) {
return
}
fgh.qwe = 6
}
Hovering over fgh at the very bottom tells me the type is Any, when it should be inferred to actually be Test at this point. While typing that line, qwe is also never suggested as an option.
No diagnostics are shown for the completed code, however, so that is good at least.