Rewrite Complex class as interface

This change allow ExceptionState to be both: State and Throwable
This commit is contained in:
Ivan Kylchik
2020-08-28 21:28:35 +03:00
committed by TeamCityServer
parent 6808151af7
commit 1d0acedc48
8 changed files with 53 additions and 49 deletions
@@ -40,7 +40,6 @@ fun generateMap(): String {
p.println("package org.jetbrains.kotlin.ir.interpreter.builtins")
p.println()
p.println("import org.jetbrains.kotlin.ir.interpreter.IrInterpreter")
p.println("import org.jetbrains.kotlin.ir.interpreter.state.*")
p.println()
p.println("/** This file is generated by org.jetbrains.kotlin.backend.common.interpreter.builtins.GenerateBuiltInsMap.generateMap(). DO NOT MODIFY MANUALLY */")
p.println()
@@ -138,10 +137,7 @@ private fun generateUnaryBody(unaryOperationsMap: Map<CallableDescriptor, Pair<S
val methodName = "${function.name}"
val parentheses = if (function is FunctionDescriptor) "()" else ""
" unaryOperation${parameters.first}(\"$methodName\", ${parameters.second}) { a -> a.$methodName$parentheses }"
} +
" unaryOperation<Any?>(\"${irNullCheck.name}\", \"${irNullCheck.valueParameters.first().type.originalKotlinType}\") { a -> a!! },\n" +
" unaryOperation<ExceptionState>(\"message\", \"Throwable\") { a -> a.getMessage() },\n" +
" unaryOperation<ExceptionState>(\"cause\", \"Throwable\") { a -> a.getCause() }"
} + " unaryOperation<Any?>(\"${irNullCheck.name}\", \"${irNullCheck.valueParameters.first().type.originalKotlinType}\") { a -> a!! }"
}
private fun generateBinaryBody(