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:
+2
-1
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrAnonymousInitializerImpl
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrExternalPackageFragmentImpl
|
||||
import org.jetbrains.kotlin.ir.descriptors.toIrBasedKotlinType
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrClassReferenceImpl
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrGetFieldImpl
|
||||
@@ -290,7 +291,7 @@ private class ScriptsToClassesLowering(val context: JvmBackendContext, val inner
|
||||
|
||||
irScript.resultProperty?.owner?.let { irResultProperty ->
|
||||
context.state.scriptSpecific.resultFieldName = irResultProperty.name.identifier
|
||||
context.state.scriptSpecific.resultTypeString = irResultProperty.backingField?.type?.render()
|
||||
context.state.scriptSpecific.resultType = irResultProperty.backingField?.type?.toIrBasedKotlinType()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user