Added tests for lambda's returning Nothing (currently do not work)

This commit is contained in:
Valentin Kipyatkov
2014-11-21 18:00:46 +03:00
parent d7d533cf39
commit bd8eaeedaa
4 changed files with 32 additions and 0 deletions
@@ -0,0 +1,8 @@
Resolve target: value-parameter val p: kotlin.String? smart-cast to kotlin.String
----------------------------------------------
fun foo(p: String?) {
val lambda = { () -> throw Exception() }
if (p == null) { lambda() }
<caret>p.size
}
@@ -0,0 +1,8 @@
fun foo(p: String?) {
val lambda = { () -> throw Exception() }
if (p == null) {
lambda()
}
<caret>p.size
}
@@ -0,0 +1,9 @@
Resolve target: value-parameter val p: kotlin.String? smart-cast to kotlin.String
----------------------------------------------
fun foo(p: String?, errorHandler: () -> Nothing) {
if (p == null) {
errorHandler()
}
<caret>p.size
}
@@ -0,0 +1,7 @@
fun foo(p: String?, errorHandler: () -> Nothing) {
if (p == null) {
errorHandler()
}
<caret>p.size
}