rename Kt to Kotlin in KtType, KtIcons
This commit is contained in:
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.generators.util.GeneratorsFileUtil
|
||||
import org.jetbrains.kotlin.resolve.TargetPlatform
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform
|
||||
import org.jetbrains.kotlin.types.KtType
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
import java.io.File
|
||||
@@ -47,8 +47,8 @@ fun generate(): String {
|
||||
p.println("/** This file is generated by org.jetbrains.kotlin.generators.evaluate:generate(). DO NOT MODIFY MANUALLY */")
|
||||
p.println()
|
||||
|
||||
val unaryOperationsMap = arrayListOf<Triple<String, List<KtType>, Boolean>>()
|
||||
val binaryOperationsMap = arrayListOf<Pair<String, List<KtType>>>()
|
||||
val unaryOperationsMap = arrayListOf<Triple<String, List<KotlinType>, Boolean>>()
|
||||
val binaryOperationsMap = arrayListOf<Pair<String, List<KotlinType>>>()
|
||||
|
||||
val builtIns = TargetPlatform.Default.builtIns
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@@ -122,7 +122,7 @@ fun generate(): String {
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
fun renderCheckUnaryOperation(name: String, params: List<KtType>): String {
|
||||
fun renderCheckUnaryOperation(name: String, params: List<KotlinType>): String {
|
||||
val isAllParamsIntegers = params.fold(true) { a, b -> a && b.isIntegerType() }
|
||||
if (!isAllParamsIntegers) {
|
||||
return "emptyUnaryFun"
|
||||
@@ -134,7 +134,7 @@ fun renderCheckUnaryOperation(name: String, params: List<KtType>): String {
|
||||
}
|
||||
}
|
||||
|
||||
fun renderCheckBinaryOperation(name: String, params: List<KtType>): String {
|
||||
fun renderCheckBinaryOperation(name: String, params: List<KotlinType>): String {
|
||||
val isAllParamsIntegers = params.fold(true) { a, b -> a && b.isIntegerType() }
|
||||
if (!isAllParamsIntegers) {
|
||||
return "emptyBinaryFun"
|
||||
@@ -153,7 +153,7 @@ fun renderCheckBinaryOperation(name: String, params: List<KtType>): String {
|
||||
}
|
||||
}
|
||||
|
||||
private fun KtType.isIntegerType(): Boolean {
|
||||
private fun KotlinType.isIntegerType(): Boolean {
|
||||
return KotlinBuiltIns.isInt(this) ||
|
||||
KotlinBuiltIns.isShort(this) ||
|
||||
KotlinBuiltIns.isByte(this) ||
|
||||
@@ -161,7 +161,7 @@ private fun KtType.isIntegerType(): Boolean {
|
||||
}
|
||||
|
||||
|
||||
private fun CallableDescriptor.getParametersTypes(): List<KtType> {
|
||||
private fun CallableDescriptor.getParametersTypes(): List<KotlinType> {
|
||||
val list = arrayListOf((getContainingDeclaration() as ClassDescriptor).getDefaultType())
|
||||
getValueParameters().map { it.getType() }.forEach {
|
||||
list.add(TypeUtils.makeNotNullable(it))
|
||||
@@ -169,4 +169,4 @@ private fun CallableDescriptor.getParametersTypes(): List<KtType> {
|
||||
return list
|
||||
}
|
||||
|
||||
private fun KtType.asString(): String = getConstructor().getDeclarationDescriptor()!!.getName().asString().toUpperCase()
|
||||
private fun KotlinType.asString(): String = getConstructor().getDeclarationDescriptor()!!.getName().asString().toUpperCase()
|
||||
|
||||
Reference in New Issue
Block a user