Restore returning of functional types from repl eval

add tests for the broken case as well for the return value representation
#KT-29490 fixed
This commit is contained in:
Ilya Chernikov
2019-01-28 10:47:01 +01:00
parent 52464fd103
commit f125600af1
4 changed files with 22 additions and 1 deletions
@@ -110,7 +110,7 @@ open class GenericReplEvaluator(
val resultFieldName = scriptResultFieldName(compileResult.lineId.no)
val resultField = scriptClass.getDeclaredField(resultFieldName).apply { isAccessible = true }
val resultValue: Any? = if (!compileResult.isFunctionType) resultField.get(scriptInstance) else "<function>"
val resultValue: Any? = resultField.get(scriptInstance)
return if (compileResult.hasResult) ReplEvalResult.ValueResult(resultFieldName, resultValue, compileResult.type)
else ReplEvalResult.UnitResult()