Debugger: Forbid 'Nothing' constructor calls in evaluated code (KT-33093)

This commit is contained in:
Yan Zhulanow
2019-11-11 18:05:36 +09:00
parent 55b3637f03
commit 82a1750d26
4 changed files with 44 additions and 0 deletions
@@ -0,0 +1,28 @@
package nothing
fun main() {
//Breakpoint!
val a = 5
}
fun block(foo: () -> Unit) {
foo()
}
// EXPRESSION: Nothing()
// RESULT: 'Nothing' can't be instantiated
// EXPRESSION: "" + Nothing()
// RESULT: 'Nothing' can't be instantiated
// EXPRESSION: run { Nothing() }
// RESULT: 'Nothing' can't be instantiated
// EXPRESSION: { Nothing() }
// RESULT: 'Nothing' can't be instantiated
// EXPRESSION: block { Nothing() }
// RESULT: 'Nothing' can't be instantiated
// EXPRESSION: fun foo() { Nothing() }
// RESULT: 'Nothing' can't be instantiated
@@ -0,0 +1,7 @@
LineBreakpoint created at nothing.kt:5
Run Java
Connected to the target VM
nothing.kt:5
Disconnected from the target VM
Process finished with exit code 0