added test for obsolete task

#KT-2336 Fixed
This commit is contained in:
Svetlana Isakova
2013-12-09 20:24:47 +04:00
parent 4d39dc38da
commit cc3f450132
2 changed files with 16 additions and 0 deletions
@@ -0,0 +1,11 @@
fun main(args: Array<String>) {
val b: Boolean? = null
if (b != null) {
if (!<!DEBUG_INFO_AUTOCAST!>b<!>) {} // OK
if (<!DEBUG_INFO_AUTOCAST!>b<!>) {} // Error: Condition must be of type jet.Boolean, but is of type jet.Boolean?
if (b<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) {} // WARN: Unnecessary non-null assertion (!!) on a non-null receiver of type jet.Boolean?
foo(<!DEBUG_INFO_AUTOCAST!>b<!>) // OK
}
}
fun foo(a: Boolean) = a