JetDiagnosticsTest migrated to TestGenerator

- test data files renamed from *.jet to *.kt
This commit is contained in:
Andrey Breslav
2012-07-10 14:04:59 +04:00
parent 6c23c093ef
commit 3d8d92c7d3
467 changed files with 2764 additions and 146 deletions
@@ -0,0 +1,91 @@
//KT-58 Allow finally around definite returns
package kt58
import java.util.concurrent.locks.Lock
fun lock<T>(lock : Lock, body : () -> T) : T {
lock.lock()
try {
return body()
}
finally {
lock.unlock(); // we report an error, but we chouldn't
}
}
//more tests
fun t1() : Int {
try {
<!UNREACHABLE_CODE!>return 1<!>
}
finally {
return 2
}
}
fun t2() : Int {
try {
return 1
}
finally {
doSmth(3)
}
}
fun t3() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
doSmth(2)
}
finally {
doSmth(3)
}
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun t4() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
doSmth(2)
}
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun t5() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
return 2
}
}
fun t6() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
return 2
}
finally {
doSmth(3)
}
}
fun t7() : Int {
try {
doSmth(1)
}
catch (e: UnsupportedOperationException) {
return 2
}
finally {
doSmth(3)
}
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun doSmth(<!UNUSED_PARAMETER!>i<!>: Int) {
}