Scripting: Implement conditional conversion for REPL result values

to support value types erased from runtime classes. See example
in added tests for motivation.
#KT-45065 fixed
also refactor launcher repl test and result type rendering
This commit is contained in:
Ilya Chernikov
2022-05-16 16:53:37 +02:00
committed by teamcity
parent b36d1be5f8
commit 92bf260057
8 changed files with 127 additions and 49 deletions
@@ -126,7 +126,7 @@ interface ReplEvalAction {
}
sealed class ReplEvalResult : Serializable {
class ValueResult(val name: String, val value: Any?, val type: String?) : ReplEvalResult() {
class ValueResult(val name: String, val value: Any?, val type: String?, val snippetInstance: Any? = null) : ReplEvalResult() {
override fun toString(): String {
val v = if (value is Function<*>) "<function${TypeIntrinsics.getFunctionArity(value)}>" else value
return "$name: $type = $v"