added tests for KT-2369, KT-2585 and KT-2972

KT-2369 Variable is not marked as uninitialized in 'finally' section
 #KT-2369 fixed
KT-2585 Code in try-finally is incorrectly marked as unreachable
 #KT-2585 fixed
KT-2972 Wrong "unused value" warning when finally is present
 #KT-2972 fixed
This commit is contained in:
Svetlana Isakova
2012-12-12 18:37:42 +04:00
parent 97058e628e
commit d7a60f5fed
6 changed files with 110 additions and 0 deletions
@@ -0,0 +1,13 @@
//KT-2369 Variable is not marked as uninitialized in 'finally' section
fun main(args: Array<String>) {
var x : Int
try {
throw Exception()
}
finally {
doSmth(<!UNINITIALIZED_VARIABLE!>x<!> + 1)
}
}
fun doSmth(a: Any?) = a