FIR: Extract StandardClassIds.KClass

This commit is contained in:
Denis Zharkov
2020-05-14 18:58:13 +03:00
parent b691b13d8e
commit e7a67c7a16
2 changed files with 3 additions and 2 deletions
@@ -49,6 +49,7 @@ object StandardClassIds {
val KProperty2 = "KProperty2".reflectId()
val KMutableProperty2 = "KMutableProperty2".reflectId()
val KFunction = "KFunction".reflectId()
val KClass = "KClass".reflectId()
val Comparable = "Comparable".baseId()
val Number = "Number".baseId()
@@ -73,4 +74,4 @@ object StandardClassIds {
val elementTypeByUnsignedArrayType = unsignedArrayTypeByElementType.inverseMap()
}
private fun <K, V> Map<K, V>.inverseMap() = entries.associate { (k, v) -> v to k }
private fun <K, V> Map<K, V>.inverseMap() = entries.associate { (k, v) -> v to k }
@@ -520,7 +520,7 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
transformedGetClassCall.resultType =
buildResolvedTypeRef {
type = ClassId.fromString("kotlin/reflect/KClass").constructClassLikeType(arrayOf(typeOfExpression), false)
type = StandardClassIds.KClass.constructClassLikeType(arrayOf(typeOfExpression), false)
}
return transformedGetClassCall.compose()
}