kt343 fixed (Exceptions while function literal ends with no unit and 'Unit' is expected)

This commit is contained in:
svtk
2011-10-09 14:58:18 +04:00
16 changed files with 738 additions and 76 deletions
@@ -0,0 +1,16 @@
import java.util.ArrayList
fun box(): String {
val list = ArrayList<Int>()
val foo : fun() : Unit = {
list.add(2) //first exception
}
foo()
val bar = {
val x = 1 //second exception
}
bar()
return if (list.get(0) == 2) "OK" else "fail"
}