Report error on non-tail suspend-calls

It only concerns calls inside another suspend function

 #KT-14924 In Progress
This commit is contained in:
Denis Zharkov
2016-11-30 17:36:18 +03:00
parent aa50f1d824
commit b8e1ce7a05
18 changed files with 272 additions and 23 deletions
@@ -11,7 +11,8 @@ class Controller {
Suspend
}
suspend fun suspendLogAndThrow(exception: Throwable): Nothing = suspendWithCurrentContinuation { c ->
// Tail calls are not allowed to be Nothing typed. See KT-15051
suspend fun suspendLogAndThrow(exception: Throwable): Any? = suspendWithCurrentContinuation { c ->
result += "throw(${exception.message});"
c.resumeWithException(exception)
Suspend