JVM IR: do not use descriptors in IrTypeMapper.writeFormalTypeParameters
This commit is contained in:
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.types
|
||||
import org.jetbrains.kotlin.builtins.PrimitiveType
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.FqNameUnsafe
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.model.*
|
||||
|
||||
interface TypeSystemCommonBackendContext : TypeSystemContext {
|
||||
@@ -41,4 +42,8 @@ interface TypeSystemCommonBackendContext : TypeSystemContext {
|
||||
|
||||
fun TypeConstructorMarker.isUnderKotlinPackage(): Boolean
|
||||
fun TypeConstructorMarker.getClassFqNameUnsafe(): FqNameUnsafe?
|
||||
|
||||
fun TypeParameterMarker.getName(): Name
|
||||
|
||||
fun KotlinTypeMarker.isInterfaceOrAnnotationClass(): Boolean
|
||||
}
|
||||
|
||||
+12
-1
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.FqNameUnsafe
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.CapturedType
|
||||
import org.jetbrains.kotlin.resolve.constants.IntegerLiteralTypeConstructor
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
||||
@@ -27,7 +28,6 @@ import org.jetbrains.kotlin.types.typeUtil.contains
|
||||
import org.jetbrains.kotlin.types.typeUtil.representativeUpperBound
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.math.max
|
||||
|
||||
interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSystemCommonBackendContext {
|
||||
override fun TypeConstructorMarker.isDenotable(): Boolean {
|
||||
@@ -541,6 +541,17 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
require(this is TypeConstructor, this::errorMessage)
|
||||
return (declarationDescriptor as ClassDescriptor).fqNameUnsafe
|
||||
}
|
||||
|
||||
override fun TypeParameterMarker.getName(): Name {
|
||||
require(this is TypeParameterDescriptor, this::errorMessage)
|
||||
return name
|
||||
}
|
||||
|
||||
override fun KotlinTypeMarker.isInterfaceOrAnnotationClass(): Boolean {
|
||||
require(this is KotlinType, this::errorMessage)
|
||||
val descriptor = constructor.declarationDescriptor
|
||||
return descriptor is ClassDescriptor && (descriptor.kind == ClassKind.INTERFACE || descriptor.kind == ClassKind.ANNOTATION_CLASS)
|
||||
}
|
||||
}
|
||||
|
||||
fun TypeVariance.convertVariance(): Variance {
|
||||
|
||||
Reference in New Issue
Block a user