do not record smart cast to not nullable type separately

This commit is contained in:
Svetlana Isakova
2014-01-31 16:33:19 +04:00
parent 9063b3803e
commit 4c1c9f8407
4 changed files with 60 additions and 35 deletions
@@ -0,0 +1,35 @@
trait A {
fun foo()
}
trait B : A {
fun bar()
}
trait C
trait D : A
fun test(a: A?) {
if (a != null && a is B?) {
<info descr="Automatically cast to B">a</info>.bar()
}
if (a is B && a is C) {
<info descr="Automatically cast to B">a</info>.foo()
}
if (a is B? && a is C?) {
<info descr="Automatically cast to B?">a</info><info>?.</info>bar()
}
a<info>?.</info>foo()
if (a is B? && a is C?) {
a<info>?.</info>foo()
}
if (a is B && a is D) {
//when it's resolved, the message should be 'Automatically cast to A'
a.<error>foo</error>
}
}