return value of try/catch/finally changed according to frontend changes

#KT-910 Fixed
This commit is contained in:
Dmitry Jemerov
2012-06-08 18:36:14 +02:00
parent 8baae95531
commit f945ec6a27
4 changed files with 34 additions and 10 deletions
@@ -80,7 +80,7 @@ fun box() : String {
if(test2()) return "test2 failed"
if(test3() != 2) return "test3 failed"
System.out?.println(test4())
if(test4() != 3) return "test4 failed"
if(test4() != 0) return "test4 failed"
if(test5() != 11) return "test5 failed"
if(test6() != 10) return "test6 failed"
@@ -0,0 +1,24 @@
import java.util.Set
import java.util.HashSet
fun foo() : Int =
try {
2
}
finally {
"s"
}
fun bar(set : Set<Int>) : Set<Int> =
try {
set
}
finally {
set.add(42)
}
fun box() : String {
if (foo() != 2) return "fail 1"
val s = bar(HashSet<Int>())
return if (s.contains(42)) "OK" else "fail 2"
}