EA-219152 (partially): Support KClass 'unboxing' in debugger

KClass can be 'unboxed' to a plain Java class. Debugger should be aware of this.
Unfortunately, this commit is not enough to fully support this scenario, as it's impossible to invoke KClass methods/extension on java.lang.Class instance. There should be an additional diagnostic that will forbid such calls.
This commit is contained in:
Yan Zhulanow
2020-01-17 19:52:30 +09:00
parent a7071344f5
commit 7490c229ac
4 changed files with 43 additions and 0 deletions
@@ -50,6 +50,11 @@ class EvaluatorValueConverter(val context: ExecutionContext) {
return true
}
if (requestedType == AsmTypes.K_CLASS_TYPE && actualType == AsmTypes.JAVA_CLASS_TYPE) {
// KClass can be represented as a Java class for simpler cases. See BoxingInterpreter.isJavaLangClassBoxing().
return true
}
val unwrappedActualType = unwrap(actualType)
val unwrappedRequestedType = unwrap(requestedType)
return unwrappedActualType == unwrappedRequestedType