de85d3df72
#KT-4009 Fixed do not add smart casted types for vars to constraint system
21 lines
500 B
Kotlin
21 lines
500 B
Kotlin
trait PsiElement {
|
|
fun getText(): String
|
|
fun getParent(): PsiElement
|
|
}
|
|
|
|
trait JetExpression : PsiElement
|
|
|
|
fun foo1(e: PsiElement) {
|
|
var current: PsiElement? = e
|
|
var first = true
|
|
while (current != null) {
|
|
if (current is JetExpression && first) {
|
|
println(current!!.getText()) // error: smart cast not possible. But it's not needed in fact!
|
|
}
|
|
|
|
current = current?.getParent()
|
|
}
|
|
}
|
|
|
|
//from library
|
|
fun println(any: Any?) = throw Exception("$any") |