Evaluator: Handle function context gracefully. Use file scope as a fallback instead of error scope
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
package defaultParameterValues
|
||||
|
||||
fun main() {
|
||||
foo(3)
|
||||
}
|
||||
|
||||
fun foo(
|
||||
b: Int,
|
||||
//Breakpoint!
|
||||
a: Int = 5
|
||||
) {
|
||||
val c = 5
|
||||
}
|
||||
|
||||
// EXPRESSION: a
|
||||
// RESULT: Parameter evaluation is not supported for '$default' methods
|
||||
|
||||
// EXPRESSION: b
|
||||
// RESULT: Parameter evaluation is not supported for '$default' methods
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at defaultParameterValues.kt:10
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
defaultParameterValues.kt:10
|
||||
Compile bytecode for a
|
||||
Compile bytecode for b
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package defaultParameterValues2
|
||||
|
||||
fun main() {
|
||||
Foo().foo()
|
||||
}
|
||||
|
||||
interface IFoo {
|
||||
//Breakpoint!
|
||||
fun foo(a: Int = 1)
|
||||
}
|
||||
|
||||
class Foo : IFoo {
|
||||
override fun foo(a: Int) {}
|
||||
}
|
||||
|
||||
// EXPRESSION: Foo()
|
||||
// RESULT: instance of defaultParameterValues2.Foo(id=ID): LdefaultParameterValues2/Foo;
|
||||
|
||||
// EXPRESSION: a
|
||||
// RESULT: Parameter evaluation is not supported for '$default' methods
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at defaultParameterValues2.kt:9
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
defaultParameterValues2.kt:9
|
||||
Compile bytecode for Foo()
|
||||
Compile bytecode for a
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
Reference in New Issue
Block a user