KT-2422 Invalid warning "Condition is always true"

#KT-2422 fixed
This commit is contained in:
Svetlana Isakova
2013-05-22 16:40:29 +04:00
parent 213e8c11c9
commit f05f616230
6 changed files with 280 additions and 33 deletions
@@ -0,0 +1,36 @@
package foo
class A(val i: Int?) {
fun test1() {
if (this@A.i != null) {
useInt(this.i)
useInt(i)
}
}
inner class B {
fun test2() {
if (i != null) {
useInt(this@A.i)
}
}
}
}
fun A.foo() {
if (this@foo.i != null) {
useInt(this.i)
useInt(i)
}
}
fun test3() {
useFunction {
if(i != null) {
useInt(this.i)
}
}
}
fun useInt(i: Int) = i
fun useFunction(f: A.() -> Unit) = f