Implement JVM IR support for scripts

This commit is contained in:
Ilya Chernikov
2020-08-31 12:09:43 +02:00
parent 01d73ba0fc
commit d7112a4500
27 changed files with 924 additions and 65 deletions
@@ -150,8 +150,8 @@ internal fun makeCompiledScript(
val module = makeCompiledModule(generationState)
val resultField = with(generationState.scriptSpecific) {
if (resultType == null || resultFieldName == null) null
else resultFieldName!! to KotlinType(DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(resultType!!))
if (resultFieldName == null) null
else resultFieldName!! to KotlinType(resultTypeString ?: DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(resultType!!))
}
return KJvmCompiledScript(
@@ -119,7 +119,7 @@ open class GenericReplCompiler(
classes,
generationState.scriptSpecific.resultFieldName != null,
classpathAddendum ?: emptyList(),
generationState.scriptSpecific.resultType?.let {
generationState.scriptSpecific.resultTypeString ?: generationState.scriptSpecific.resultType?.let {
DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(it)
},
null