Debugger: Prohibit 'suspend fun' calls in evaluated expressions
Currently, it's impossible to call suspend functions in evaluated code fragments (see KT-31701). This commit officially prohibits such calls, so users will see a semi-friendly error message.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package suspendCalls
|
||||
|
||||
suspend fun main() {
|
||||
//Breakpoint!
|
||||
foo()
|
||||
}
|
||||
|
||||
suspend fun foo(): Int = 42
|
||||
|
||||
// EXPRESSION: foo()
|
||||
// RESULT: Evaluation of 'suspend' calls is not supported
|
||||
@@ -0,0 +1,7 @@
|
||||
LineBreakpoint created at suspendCalls.kt:5
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
suspendCalls.kt:5
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
Reference in New Issue
Block a user