FIR2IR: support RawType internal annotation

This commit is contained in:
Mikhail Glukhikh
2021-12-07 11:58:21 +03:00
committed by TeamCityServer
parent f8a6ab9536
commit 5b058cfcdc
10 changed files with 112 additions and 88 deletions
@@ -40,6 +40,7 @@ class Fir2IrJvmSpecialAnnotationSymbolProvider : Fir2IrSpecialSymbolProvider() {
when (id) { when (id) {
ENHANCED_NULLABILITY_ID -> id.toIrClass(kotlinJvmInternalPackage).symbol ENHANCED_NULLABILITY_ID -> id.toIrClass(kotlinJvmInternalPackage).symbol
FLEXIBLE_NULLABILITY_ID -> id.toIrClass(kotlinInternalIrPackage).symbol FLEXIBLE_NULLABILITY_ID -> id.toIrClass(kotlinInternalIrPackage).symbol
RAW_TYPE_ANNOTATION_ID -> id.toIrClass(kotlinInternalIrPackage).symbol
else -> null else -> null
} }
@@ -59,5 +60,7 @@ class Fir2IrJvmSpecialAnnotationSymbolProvider : Fir2IrSpecialSymbolProvider() {
private val ENHANCED_NULLABILITY_ID = ClassId.topLevel(JvmAnnotationNames.ENHANCED_NULLABILITY_ANNOTATION) private val ENHANCED_NULLABILITY_ID = ClassId.topLevel(JvmAnnotationNames.ENHANCED_NULLABILITY_ANNOTATION)
private val FLEXIBLE_NULLABILITY_ID = private val FLEXIBLE_NULLABILITY_ID =
ClassId.topLevel(IrBuiltIns.KOTLIN_INTERNAL_IR_FQN.child(Name.identifier("FlexibleNullability"))) ClassId.topLevel(IrBuiltIns.KOTLIN_INTERNAL_IR_FQN.child(Name.identifier("FlexibleNullability")))
private val RAW_TYPE_ANNOTATION_ID =
ClassId.topLevel(IrBuiltIns.KOTLIN_INTERNAL_IR_FQN.child(Name.identifier("RawType")))
} }
} }
@@ -44,6 +44,13 @@ class Fir2IrBuiltIns(
internal fun extensionFunctionTypeAnnotationConstructorCall(): IrConstructorCall? = internal fun extensionFunctionTypeAnnotationConstructorCall(): IrConstructorCall? =
extensionFunctionTypeAnnotationSymbol?.toConstructorCall() extensionFunctionTypeAnnotationSymbol?.toConstructorCall()
private val rawTypeAnnotationSymbol by lazy {
annotationSymbolById(StandardClassIds.Annotations.RawTypeAnnotation)
}
internal fun rawTypeAnnotationConstructorCall(): IrConstructorCall? =
rawTypeAnnotationSymbol?.toConstructorCall()
private fun annotationSymbolById(id: ClassId): IrClassSymbol? = private fun annotationSymbolById(id: ClassId): IrClassSymbol? =
provider?.getClassSymbolById(id) ?: session.symbolProvider.getClassLikeSymbolByClassId(id)?.toSymbol( provider?.getClassSymbolById(id) ?: session.symbolProvider.getClassLikeSymbolByClassId(id)?.toSymbol(
session, classifierStorage, ConversionTypeContext.DEFAULT session, classifierStorage, ConversionTypeContext.DEFAULT
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.ir.types.impl.IrStarProjectionImpl
import org.jetbrains.kotlin.ir.types.impl.makeTypeProjection import org.jetbrains.kotlin.ir.types.impl.makeTypeProjection
import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.StandardClassIds import org.jetbrains.kotlin.name.StandardClassIds
import org.jetbrains.kotlin.name.StandardClassIds.Annotations.ExtensionFunctionType
import org.jetbrains.kotlin.types.TypeApproximatorConfiguration import org.jetbrains.kotlin.types.TypeApproximatorConfiguration
import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.types.Variance
@@ -100,7 +101,8 @@ class Fir2IrTypeConverter(
fun ConeKotlinType.toIrType( fun ConeKotlinType.toIrType(
typeContext: ConversionTypeContext = ConversionTypeContext.DEFAULT, typeContext: ConversionTypeContext = ConversionTypeContext.DEFAULT,
annotations: List<FirAnnotation> = emptyList(), annotations: List<FirAnnotation> = emptyList(),
hasFlexibleNullability: Boolean = false hasFlexibleNullability: Boolean = false,
addRawTypeAnnotation: Boolean = false
): IrType { ): IrType {
return when (this) { return when (this) {
is ConeKotlinErrorType -> createErrorType() is ConeKotlinErrorType -> createErrorType()
@@ -122,13 +124,6 @@ class Fir2IrTypeConverter(
typeAnnotations += it typeAnnotations += it
} }
} }
isExtensionFunctionType -> {
if (annotations.getAnnotationsByClassId(StandardClassIds.Annotations.ExtensionFunctionType).isEmpty()) {
builtIns.extensionFunctionTypeAnnotationConstructorCall()?.let {
typeAnnotations += it
}
}
}
hasFlexibleNullability -> { hasFlexibleNullability -> {
builtIns.flexibleNullabilityAnnotationConstructorCall()?.let { builtIns.flexibleNullabilityAnnotationConstructorCall()?.let {
typeAnnotations += it typeAnnotations += it
@@ -136,6 +131,18 @@ class Fir2IrTypeConverter(
} }
} }
if (isExtensionFunctionType && annotations.getAnnotationsByClassId(ExtensionFunctionType).isEmpty()) {
builtIns.extensionFunctionTypeAnnotationConstructorCall()?.let {
typeAnnotations += it
}
}
if (addRawTypeAnnotation) {
builtIns.rawTypeAnnotationConstructorCall()?.let {
typeAnnotations += it
}
}
for (attributeAnnotation in attributes.customAnnotations) { for (attributeAnnotation in attributes.customAnnotations) {
if (annotations.any { it.classId == attributeAnnotation.classId }) continue if (annotations.any { it.classId == attributeAnnotation.classId }) continue
typeAnnotations += callGenerator.convertToIrConstructorCall(attributeAnnotation) as? IrConstructorCall ?: continue typeAnnotations += callGenerator.convertToIrConstructorCall(attributeAnnotation) as? IrConstructorCall ?: continue
@@ -143,9 +150,19 @@ class Fir2IrTypeConverter(
val expandedType = fullyExpandedType(session) val expandedType = fullyExpandedType(session)
val approximatedType = approximateType(expandedType) val approximatedType = approximateType(expandedType)
IrSimpleTypeImpl( IrSimpleTypeImpl(
irSymbol, !typeContext.definitelyNotNull && approximatedType.isMarkedNullable, irSymbol,
approximatedType.typeArguments.map { it.toIrTypeArgument(typeContext) }, hasQuestionMark = !typeContext.definitelyNotNull && approximatedType.isMarkedNullable,
typeAnnotations arguments = approximatedType.typeArguments.map { it.toIrTypeArgument(typeContext) },
annotations = typeAnnotations
)
}
is ConeRawType -> {
// Upper bound has star projections here, so we take lower one
// (some reflection tests rely on this)
lowerBound.toIrType(
typeContext,
hasFlexibleNullability = lowerBound.nullability != upperBound.nullability,
addRawTypeAnnotation = true
) )
} }
is ConeFlexibleType -> { is ConeFlexibleType -> {
@@ -1,7 +1,4 @@
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: Expected <test.C<java.lang.Object?, java.lang.Number> (Kotlin reflection is not available)>,
// actual <test.C<*, *> (Kotlin reflection is not available)>
// WITH_STDLIB // WITH_STDLIB
// FILE: box.kt // FILE: box.kt
@@ -1,9 +1,6 @@
// !API_VERSION: 1.5 // !API_VERSION: 1.5
// !OPT_IN: kotlin.ExperimentalStdlibApi // !OPT_IN: kotlin.ExperimentalStdlibApi
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: Expected <test.C<java.lang.Object?, java.lang.Number> (Kotlin reflection is not available)>,
// actual <test.C<*, *> (Kotlin reflection is not available)>
// WITH_STDLIB // WITH_STDLIB
// FILE: box.kt // FILE: box.kt
@@ -1,6 +1,6 @@
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND_FIR: JVM_IR
// FIR status: Fail 1: test.C<*, *> // FIR status: Fail 3: (kotlin.collections.MutableList<kotlin.Any?>..kotlin.collections.MutableList<*>?)
// WITH_REFLECT // WITH_REFLECT
// FILE: box.kt // FILE: box.kt
@@ -1,8 +1,6 @@
// !API_VERSION: 1.5 // !API_VERSION: 1.5
// !OPT_IN: kotlin.ExperimentalStdlibApi // !OPT_IN: kotlin.ExperimentalStdlibApi
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: Fail 1: test.C<*, *>
// WITH_REFLECT // WITH_REFLECT
// FILE: box.kt // FILE: box.kt
@@ -59,23 +59,23 @@ FILE fqName:<root> fileName:/rawTypeInSignature.kt
overridden: overridden:
public open fun toString (): kotlin.String declared in kotlin.Any public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any $this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:testReturnsRawGenericInv visibility:public modality:FINAL <> (j:<root>.JRaw) returnType:@[FlexibleNullability] <root>.GenericInv<*>? FUN name:testReturnsRawGenericInv visibility:public modality:FINAL <> (j:<root>.JRaw) returnType:@[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number>
VALUE_PARAMETER name:j index:0 type:<root>.JRaw VALUE_PARAMETER name:j index:0 type:<root>.JRaw
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericInv (j: <root>.JRaw): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>' RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericInv (j: <root>.JRaw): @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> declared in <root>'
CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericInv<*>? origin=null CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> declared in <root>.JRaw' type=@[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> origin=null
$this: GET_VAR 'j: <root>.JRaw declared in <root>.testReturnsRawGenericInv' type=<root>.JRaw origin=null $this: GET_VAR 'j: <root>.JRaw declared in <root>.testReturnsRawGenericInv' type=<root>.JRaw origin=null
FUN name:testReturnsRawGenericIn visibility:public modality:FINAL <> (j:<root>.JRaw) returnType:@[FlexibleNullability] <root>.GenericIn<*>? FUN name:testReturnsRawGenericIn visibility:public modality:FINAL <> (j:<root>.JRaw) returnType:@[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number>
VALUE_PARAMETER name:j index:0 type:<root>.JRaw VALUE_PARAMETER name:j index:0 type:<root>.JRaw
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericIn (j: <root>.JRaw): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>' RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericIn (j: <root>.JRaw): @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> declared in <root>'
CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericIn<*>? origin=null CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> declared in <root>.JRaw' type=@[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> origin=null
$this: GET_VAR 'j: <root>.JRaw declared in <root>.testReturnsRawGenericIn' type=<root>.JRaw origin=null $this: GET_VAR 'j: <root>.JRaw declared in <root>.testReturnsRawGenericIn' type=<root>.JRaw origin=null
FUN name:testReturnsRawGenericOut visibility:public modality:FINAL <> (j:<root>.JRaw) returnType:@[FlexibleNullability] <root>.GenericOut<*>? FUN name:testReturnsRawGenericOut visibility:public modality:FINAL <> (j:<root>.JRaw) returnType:@[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number>
VALUE_PARAMETER name:j index:0 type:<root>.JRaw VALUE_PARAMETER name:j index:0 type:<root>.JRaw
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericOut (j: <root>.JRaw): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>' RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericOut (j: <root>.JRaw): @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> declared in <root>'
CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericOut<*>? origin=null CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> declared in <root>.JRaw' type=@[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> origin=null
$this: GET_VAR 'j: <root>.JRaw declared in <root>.testReturnsRawGenericOut' type=<root>.JRaw origin=null $this: GET_VAR 'j: <root>.JRaw declared in <root>.testReturnsRawGenericOut' type=<root>.JRaw origin=null
CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[<root>.JRaw] CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[<root>.JRaw]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KRaw
@@ -84,82 +84,86 @@ FILE fqName:<root> fileName:/rawTypeInSignature.kt
BLOCK_BODY BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[<root>.JRaw]' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[<root>.JRaw]'
FUN DELEGATED_MEMBER name:takesRawList visibility:public modality:OPEN <> ($this:<root>.KRaw, list:@[FlexibleNullability] kotlin.collections.List<*>?) returnType:kotlin.Unit FUN DELEGATED_MEMBER name:takesRawList visibility:public modality:OPEN <> ($this:<root>.KRaw, list:@[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?>) returnType:kotlin.Unit
overridden: overridden:
public abstract fun takesRawList (list: @[FlexibleNullability] kotlin.collections.List<*>?): kotlin.Unit declared in <root>.JRaw public abstract fun takesRawList (list: @[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?>): kotlin.Unit declared in <root>.JRaw
$this: VALUE_PARAMETER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER name:<this> type:<root>.KRaw
VALUE_PARAMETER name:list index:0 type:@[FlexibleNullability] kotlin.collections.List<*>? VALUE_PARAMETER name:list index:0 type:@[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?>
BLOCK_BODY BLOCK_BODY
CALL 'public abstract fun takesRawList (list: @[FlexibleNullability] kotlin.collections.List<*>?): kotlin.Unit declared in <root>.JRaw' type=kotlin.Unit origin=null CALL 'public abstract fun takesRawList (list: @[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?>): kotlin.Unit declared in <root>.JRaw' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.takesRawList' type=<root>.KRaw origin=null receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.takesRawList' type=<root>.KRaw origin=null
list: GET_VAR 'list: @[FlexibleNullability] kotlin.collections.List<*>? declared in <root>.KRaw.takesRawList' type=@[FlexibleNullability] kotlin.collections.List<*>? origin=null list: GET_VAR 'list: @[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?> declared in <root>.KRaw.takesRawList' type=@[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?> origin=null
FUN DELEGATED_MEMBER name:returnsRawList visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] kotlin.collections.List<*>? FUN DELEGATED_MEMBER name:returnsRawList visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?>
overridden: overridden:
public abstract fun returnsRawList (): @[FlexibleNullability] kotlin.collections.List<*>? declared in <root>.JRaw public abstract fun returnsRawList (): @[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?> declared in <root>.JRaw
$this: VALUE_PARAMETER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER name:<this> type:<root>.KRaw
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsRawList (): @[FlexibleNullability] kotlin.collections.List<*>? declared in <root>.KRaw' RETURN type=kotlin.Nothing from='public open fun returnsRawList (): @[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?> declared in <root>.KRaw'
CALL 'public abstract fun returnsRawList (): @[FlexibleNullability] kotlin.collections.List<*>? declared in <root>.JRaw' type=@[FlexibleNullability] kotlin.collections.List<*>? origin=null TYPE_OP type=@[RawType] kotlin.collections.MutableList<kotlin.Any?> origin=IMPLICIT_NOTNULL typeOperand=@[RawType] kotlin.collections.MutableList<kotlin.Any?>
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null CALL 'public abstract fun returnsRawList (): @[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?> declared in <root>.JRaw' type=@[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?> origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.returnsRawList' type=<root>.KRaw origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericInv visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] <root>.GenericInv<*>?) returnType:kotlin.Unit receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.returnsRawList' type=<root>.KRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericInv visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number>) returnType:kotlin.Unit
overridden: overridden:
public abstract fun takesRawGenericInv (g: @[FlexibleNullability] <root>.GenericInv<*>?): kotlin.Unit declared in <root>.JRaw public abstract fun takesRawGenericInv (g: @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number>): kotlin.Unit declared in <root>.JRaw
$this: VALUE_PARAMETER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER name:<this> type:<root>.KRaw
VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] <root>.GenericInv<*>? VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number>
BLOCK_BODY BLOCK_BODY
CALL 'public abstract fun takesRawGenericInv (g: @[FlexibleNullability] <root>.GenericInv<*>?): kotlin.Unit declared in <root>.JRaw' type=kotlin.Unit origin=null CALL 'public abstract fun takesRawGenericInv (g: @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number>): kotlin.Unit declared in <root>.JRaw' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.takesRawGenericInv' type=<root>.KRaw origin=null receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.takesRawGenericInv' type=<root>.KRaw origin=null
g: GET_VAR 'g: @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>.KRaw.takesRawGenericInv' type=@[FlexibleNullability] <root>.GenericInv<*>? origin=null g: GET_VAR 'g: @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> declared in <root>.KRaw.takesRawGenericInv' type=@[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> origin=null
FUN DELEGATED_MEMBER name:returnsRawGenericInv visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] <root>.GenericInv<*>? FUN DELEGATED_MEMBER name:returnsRawGenericInv visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number>
overridden: overridden:
public abstract fun returnsRawGenericInv (): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>.JRaw public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> declared in <root>.JRaw
$this: VALUE_PARAMETER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER name:<this> type:<root>.KRaw
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericInv (): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>.KRaw' RETURN type=kotlin.Nothing from='public open fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> declared in <root>.KRaw'
CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericInv<*>? origin=null TYPE_OP type=@[RawType] <root>.GenericInv<kotlin.Number> origin=IMPLICIT_NOTNULL typeOperand=@[RawType] <root>.GenericInv<kotlin.Number>
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> declared in <root>.JRaw' type=@[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.returnsRawGenericInv' type=<root>.KRaw origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericIn visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] <root>.GenericIn<*>?) returnType:kotlin.Unit receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.returnsRawGenericInv' type=<root>.KRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericIn visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number>) returnType:kotlin.Unit
overridden: overridden:
public abstract fun takesRawGenericIn (g: @[FlexibleNullability] <root>.GenericIn<*>?): kotlin.Unit declared in <root>.JRaw public abstract fun takesRawGenericIn (g: @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number>): kotlin.Unit declared in <root>.JRaw
$this: VALUE_PARAMETER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER name:<this> type:<root>.KRaw
VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] <root>.GenericIn<*>? VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number>
BLOCK_BODY BLOCK_BODY
CALL 'public abstract fun takesRawGenericIn (g: @[FlexibleNullability] <root>.GenericIn<*>?): kotlin.Unit declared in <root>.JRaw' type=kotlin.Unit origin=null CALL 'public abstract fun takesRawGenericIn (g: @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number>): kotlin.Unit declared in <root>.JRaw' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.takesRawGenericIn' type=<root>.KRaw origin=null receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.takesRawGenericIn' type=<root>.KRaw origin=null
g: GET_VAR 'g: @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>.KRaw.takesRawGenericIn' type=@[FlexibleNullability] <root>.GenericIn<*>? origin=null g: GET_VAR 'g: @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> declared in <root>.KRaw.takesRawGenericIn' type=@[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> origin=null
FUN DELEGATED_MEMBER name:returnsRawGenericIn visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] <root>.GenericIn<*>? FUN DELEGATED_MEMBER name:returnsRawGenericIn visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number>
overridden: overridden:
public abstract fun returnsRawGenericIn (): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>.JRaw public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> declared in <root>.JRaw
$this: VALUE_PARAMETER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER name:<this> type:<root>.KRaw
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericIn (): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>.KRaw' RETURN type=kotlin.Nothing from='public open fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> declared in <root>.KRaw'
CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericIn<*>? origin=null TYPE_OP type=@[RawType] <root>.GenericIn<kotlin.Number> origin=IMPLICIT_NOTNULL typeOperand=@[RawType] <root>.GenericIn<kotlin.Number>
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> declared in <root>.JRaw' type=@[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.returnsRawGenericIn' type=<root>.KRaw origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericOut visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] <root>.GenericOut<*>?) returnType:kotlin.Unit receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.returnsRawGenericIn' type=<root>.KRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericOut visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number>) returnType:kotlin.Unit
overridden: overridden:
public abstract fun takesRawGenericOut (g: @[FlexibleNullability] <root>.GenericOut<*>?): kotlin.Unit declared in <root>.JRaw public abstract fun takesRawGenericOut (g: @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number>): kotlin.Unit declared in <root>.JRaw
$this: VALUE_PARAMETER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER name:<this> type:<root>.KRaw
VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] <root>.GenericOut<*>? VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number>
BLOCK_BODY BLOCK_BODY
CALL 'public abstract fun takesRawGenericOut (g: @[FlexibleNullability] <root>.GenericOut<*>?): kotlin.Unit declared in <root>.JRaw' type=kotlin.Unit origin=null CALL 'public abstract fun takesRawGenericOut (g: @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number>): kotlin.Unit declared in <root>.JRaw' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.takesRawGenericOut' type=<root>.KRaw origin=null receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.takesRawGenericOut' type=<root>.KRaw origin=null
g: GET_VAR 'g: @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>.KRaw.takesRawGenericOut' type=@[FlexibleNullability] <root>.GenericOut<*>? origin=null g: GET_VAR 'g: @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> declared in <root>.KRaw.takesRawGenericOut' type=@[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> origin=null
FUN DELEGATED_MEMBER name:returnsRawGenericOut visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] <root>.GenericOut<*>? FUN DELEGATED_MEMBER name:returnsRawGenericOut visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number>
overridden: overridden:
public abstract fun returnsRawGenericOut (): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>.JRaw public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> declared in <root>.JRaw
$this: VALUE_PARAMETER name:<this> type:<root>.KRaw $this: VALUE_PARAMETER name:<this> type:<root>.KRaw
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericOut (): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>.KRaw' RETURN type=kotlin.Nothing from='public open fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> declared in <root>.KRaw'
CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericOut<*>? origin=null TYPE_OP type=@[RawType] <root>.GenericOut<kotlin.Number> origin=IMPLICIT_NOTNULL typeOperand=@[RawType] <root>.GenericOut<kotlin.Number>
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> declared in <root>.JRaw' type=@[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.returnsRawGenericOut' type=<root>.KRaw origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]' type=<root>.JRaw origin=null
receiver: GET_VAR '<this>: <root>.KRaw declared in <root>.KRaw.returnsRawGenericOut' type=<root>.KRaw origin=null
FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final] FIELD DELEGATE name:<$$delegate_0> type:<root>.JRaw visibility:local [final]
EXPRESSION_BODY EXPRESSION_BODY
GET_VAR 'j: <root>.JRaw declared in <root>.KRaw.<init>' type=<root>.JRaw origin=null GET_VAR 'j: <root>.JRaw declared in <root>.KRaw.<init>' type=<root>.JRaw origin=null
@@ -25,15 +25,15 @@ class GenericOut<out T : Number> {
} }
fun testReturnsRawGenericInv(j: JRaw): @FlexibleNullability GenericInv<*>? { fun testReturnsRawGenericInv(j: JRaw): @FlexibleNullability @RawType GenericInv<Number> {
return j.returnsRawGenericInv() return j.returnsRawGenericInv()
} }
fun testReturnsRawGenericIn(j: JRaw): @FlexibleNullability GenericIn<*>? { fun testReturnsRawGenericIn(j: JRaw): @FlexibleNullability @RawType GenericIn<Number> {
return j.returnsRawGenericIn() return j.returnsRawGenericIn()
} }
fun testReturnsRawGenericOut(j: JRaw): @FlexibleNullability GenericOut<*>? { fun testReturnsRawGenericOut(j: JRaw): @FlexibleNullability @RawType GenericOut<Number> {
return j.returnsRawGenericOut() return j.returnsRawGenericOut()
} }
@@ -44,36 +44,36 @@ class KRaw : JRaw {
} }
override fun takesRawList(list: @FlexibleNullability List<*>?) { override fun takesRawList(list: @FlexibleNullability @RawType MutableList<Any?>) {
<this>.#<$$delegate_0>.takesRawList(list = list) <this>.#<$$delegate_0>.takesRawList(list = list)
} }
override fun returnsRawList(): @FlexibleNullability List<*>? { override fun returnsRawList(): @FlexibleNullability @RawType MutableList<Any?> {
return <this>.#<$$delegate_0>.returnsRawList() return <this>.#<$$delegate_0>.returnsRawList() /*!! @RawType MutableList<Any?> */
} }
override fun takesRawGenericInv(g: @FlexibleNullability GenericInv<*>?) { override fun takesRawGenericInv(g: @FlexibleNullability @RawType GenericInv<Number>) {
<this>.#<$$delegate_0>.takesRawGenericInv(g = g) <this>.#<$$delegate_0>.takesRawGenericInv(g = g)
} }
override fun returnsRawGenericInv(): @FlexibleNullability GenericInv<*>? { override fun returnsRawGenericInv(): @FlexibleNullability @RawType GenericInv<Number> {
return <this>.#<$$delegate_0>.returnsRawGenericInv() return <this>.#<$$delegate_0>.returnsRawGenericInv() /*!! @RawType GenericInv<Number> */
} }
override fun takesRawGenericIn(g: @FlexibleNullability GenericIn<*>?) { override fun takesRawGenericIn(g: @FlexibleNullability @RawType GenericIn<Number>) {
<this>.#<$$delegate_0>.takesRawGenericIn(g = g) <this>.#<$$delegate_0>.takesRawGenericIn(g = g)
} }
override fun returnsRawGenericIn(): @FlexibleNullability GenericIn<*>? { override fun returnsRawGenericIn(): @FlexibleNullability @RawType GenericIn<Number> {
return <this>.#<$$delegate_0>.returnsRawGenericIn() return <this>.#<$$delegate_0>.returnsRawGenericIn() /*!! @RawType GenericIn<Number> */
} }
override fun takesRawGenericOut(g: @FlexibleNullability GenericOut<*>?) { override fun takesRawGenericOut(g: @FlexibleNullability @RawType GenericOut<Number>) {
<this>.#<$$delegate_0>.takesRawGenericOut(g = g) <this>.#<$$delegate_0>.takesRawGenericOut(g = g)
} }
override fun returnsRawGenericOut(): @FlexibleNullability GenericOut<*>? { override fun returnsRawGenericOut(): @FlexibleNullability @RawType GenericOut<Number> {
return <this>.#<$$delegate_0>.returnsRawGenericOut() return <this>.#<$$delegate_0>.returnsRawGenericOut() /*!! @RawType GenericOut<Number> */
} }
local /* final field */ val <$$delegate_0>: JRaw = j local /* final field */ val <$$delegate_0>: JRaw = j
@@ -153,6 +153,7 @@ object StandardClassIds {
val JvmDefault = "JvmDefault".jvmId() val JvmDefault = "JvmDefault".jvmId()
val JvmRepeatable = "JvmRepeatable".jvmId() val JvmRepeatable = "JvmRepeatable".jvmId()
val RawTypeAnnotation = "RawType".internalIrId()
val FlexibleNullability = "FlexibleNullability".internalIrId() val FlexibleNullability = "FlexibleNullability".internalIrId()
val EnhancedNullability = "EnhancedNullability".jvmInternalId() val EnhancedNullability = "EnhancedNullability".jvmInternalId()