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) {
ENHANCED_NULLABILITY_ID -> id.toIrClass(kotlinJvmInternalPackage).symbol
FLEXIBLE_NULLABILITY_ID -> id.toIrClass(kotlinInternalIrPackage).symbol
RAW_TYPE_ANNOTATION_ID -> id.toIrClass(kotlinInternalIrPackage).symbol
else -> null
}
@@ -59,5 +60,7 @@ class Fir2IrJvmSpecialAnnotationSymbolProvider : Fir2IrSpecialSymbolProvider() {
private val ENHANCED_NULLABILITY_ID = ClassId.topLevel(JvmAnnotationNames.ENHANCED_NULLABILITY_ANNOTATION)
private val FLEXIBLE_NULLABILITY_ID =
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? =
extensionFunctionTypeAnnotationSymbol?.toConstructorCall()
private val rawTypeAnnotationSymbol by lazy {
annotationSymbolById(StandardClassIds.Annotations.RawTypeAnnotation)
}
internal fun rawTypeAnnotationConstructorCall(): IrConstructorCall? =
rawTypeAnnotationSymbol?.toConstructorCall()
private fun annotationSymbolById(id: ClassId): IrClassSymbol? =
provider?.getClassSymbolById(id) ?: session.symbolProvider.getClassLikeSymbolByClassId(id)?.toSymbol(
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.name.ClassId
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.Variance
@@ -100,7 +101,8 @@ class Fir2IrTypeConverter(
fun ConeKotlinType.toIrType(
typeContext: ConversionTypeContext = ConversionTypeContext.DEFAULT,
annotations: List<FirAnnotation> = emptyList(),
hasFlexibleNullability: Boolean = false
hasFlexibleNullability: Boolean = false,
addRawTypeAnnotation: Boolean = false
): IrType {
return when (this) {
is ConeKotlinErrorType -> createErrorType()
@@ -122,13 +124,6 @@ class Fir2IrTypeConverter(
typeAnnotations += it
}
}
isExtensionFunctionType -> {
if (annotations.getAnnotationsByClassId(StandardClassIds.Annotations.ExtensionFunctionType).isEmpty()) {
builtIns.extensionFunctionTypeAnnotationConstructorCall()?.let {
typeAnnotations += it
}
}
}
hasFlexibleNullability -> {
builtIns.flexibleNullabilityAnnotationConstructorCall()?.let {
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) {
if (annotations.any { it.classId == attributeAnnotation.classId }) continue
typeAnnotations += callGenerator.convertToIrConstructorCall(attributeAnnotation) as? IrConstructorCall ?: continue
@@ -143,9 +150,19 @@ class Fir2IrTypeConverter(
val expandedType = fullyExpandedType(session)
val approximatedType = approximateType(expandedType)
IrSimpleTypeImpl(
irSymbol, !typeContext.definitelyNotNull && approximatedType.isMarkedNullable,
approximatedType.typeArguments.map { it.toIrTypeArgument(typeContext) },
typeAnnotations
irSymbol,
hasQuestionMark = !typeContext.definitelyNotNull && approximatedType.isMarkedNullable,
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 -> {
@@ -1,7 +1,4 @@
// 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
// FILE: box.kt
@@ -1,9 +1,6 @@
// !API_VERSION: 1.5
// !OPT_IN: kotlin.ExperimentalStdlibApi
// 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
// FILE: box.kt
@@ -1,6 +1,6 @@
// TARGET_BACKEND: JVM
// 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
// FILE: box.kt
@@ -1,8 +1,6 @@
// !API_VERSION: 1.5
// !OPT_IN: kotlin.ExperimentalStdlibApi
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: Fail 1: test.C<*, *>
// WITH_REFLECT
// FILE: box.kt
@@ -59,23 +59,23 @@ FILE fqName:<root> fileName:/rawTypeInSignature.kt
overridden:
public open fun toString (): kotlin.String declared in 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
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericInv (j: <root>.JRaw): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>'
CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericInv<*>? origin=null
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] @[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
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
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericIn (j: <root>.JRaw): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>'
CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericIn<*>? origin=null
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] @[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
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
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericOut (j: <root>.JRaw): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>'
CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericOut<*>? origin=null
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] @[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
CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[<root>.JRaw]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KRaw
@@ -84,82 +84,86 @@ FILE fqName:<root> fileName:/rawTypeInSignature.kt
BLOCK_BODY
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]'
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:
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
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
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
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
FUN DELEGATED_MEMBER name:returnsRawList visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] kotlin.collections.List<*>?
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] @[RawType] kotlin.collections.MutableList<kotlin.Any?>
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
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsRawList (): @[FlexibleNullability] kotlin.collections.List<*>? declared in <root>.KRaw'
CALL 'public abstract fun returnsRawList (): @[FlexibleNullability] kotlin.collections.List<*>? declared in <root>.JRaw' type=@[FlexibleNullability] kotlin.collections.List<*>? 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.returnsRawList' type=<root>.KRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericInv visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] <root>.GenericInv<*>?) returnType:kotlin.Unit
RETURN type=kotlin.Nothing from='public open fun returnsRawList (): @[FlexibleNullability] @[RawType] kotlin.collections.MutableList<kotlin.Any?> declared in <root>.KRaw'
TYPE_OP type=@[RawType] kotlin.collections.MutableList<kotlin.Any?> origin=IMPLICIT_NOTNULL typeOperand=@[RawType] kotlin.collections.MutableList<kotlin.Any?>
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
$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.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:
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
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
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
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
FUN DELEGATED_MEMBER name:returnsRawGenericInv visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] <root>.GenericInv<*>?
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] @[RawType] <root>.GenericInv<kotlin.Number>
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
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericInv (): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>.KRaw'
CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] <root>.GenericInv<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericInv<*>? 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.returnsRawGenericInv' type=<root>.KRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericIn visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] <root>.GenericIn<*>?) returnType:kotlin.Unit
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] <root>.GenericInv<kotlin.Number> declared in <root>.KRaw'
TYPE_OP type=@[RawType] <root>.GenericInv<kotlin.Number> origin=IMPLICIT_NOTNULL typeOperand=@[RawType] <root>.GenericInv<kotlin.Number>
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_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.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:
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
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
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
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
FUN DELEGATED_MEMBER name:returnsRawGenericIn visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] <root>.GenericIn<*>?
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] @[RawType] <root>.GenericIn<kotlin.Number>
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
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericIn (): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>.KRaw'
CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] <root>.GenericIn<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericIn<*>? 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.returnsRawGenericIn' type=<root>.KRaw origin=null
FUN DELEGATED_MEMBER name:takesRawGenericOut visibility:public modality:OPEN <> ($this:<root>.KRaw, g:@[FlexibleNullability] <root>.GenericOut<*>?) returnType:kotlin.Unit
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] <root>.GenericIn<kotlin.Number> declared in <root>.KRaw'
TYPE_OP type=@[RawType] <root>.GenericIn<kotlin.Number> origin=IMPLICIT_NOTNULL typeOperand=@[RawType] <root>.GenericIn<kotlin.Number>
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_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.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:
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
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
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
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
FUN DELEGATED_MEMBER name:returnsRawGenericOut visibility:public modality:OPEN <> ($this:<root>.KRaw) returnType:@[FlexibleNullability] <root>.GenericOut<*>?
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] @[RawType] <root>.GenericOut<kotlin.Number>
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
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericOut (): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>.KRaw'
CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] <root>.GenericOut<*>? declared in <root>.JRaw' type=@[FlexibleNullability] <root>.GenericOut<*>? 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
RETURN type=kotlin.Nothing from='public open fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] <root>.GenericOut<kotlin.Number> declared in <root>.KRaw'
TYPE_OP type=@[RawType] <root>.GenericOut<kotlin.Number> origin=IMPLICIT_NOTNULL typeOperand=@[RawType] <root>.GenericOut<kotlin.Number>
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_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]
EXPRESSION_BODY
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()
}
fun testReturnsRawGenericIn(j: JRaw): @FlexibleNullability GenericIn<*>? {
fun testReturnsRawGenericIn(j: JRaw): @FlexibleNullability @RawType GenericIn<Number> {
return j.returnsRawGenericIn()
}
fun testReturnsRawGenericOut(j: JRaw): @FlexibleNullability GenericOut<*>? {
fun testReturnsRawGenericOut(j: JRaw): @FlexibleNullability @RawType GenericOut<Number> {
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)
}
override fun returnsRawList(): @FlexibleNullability List<*>? {
return <this>.#<$$delegate_0>.returnsRawList()
override fun returnsRawList(): @FlexibleNullability @RawType MutableList<Any?> {
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)
}
override fun returnsRawGenericInv(): @FlexibleNullability GenericInv<*>? {
return <this>.#<$$delegate_0>.returnsRawGenericInv()
override fun returnsRawGenericInv(): @FlexibleNullability @RawType GenericInv<Number> {
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)
}
override fun returnsRawGenericIn(): @FlexibleNullability GenericIn<*>? {
return <this>.#<$$delegate_0>.returnsRawGenericIn()
override fun returnsRawGenericIn(): @FlexibleNullability @RawType GenericIn<Number> {
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)
}
override fun returnsRawGenericOut(): @FlexibleNullability GenericOut<*>? {
return <this>.#<$$delegate_0>.returnsRawGenericOut()
override fun returnsRawGenericOut(): @FlexibleNullability @RawType GenericOut<Number> {
return <this>.#<$$delegate_0>.returnsRawGenericOut() /*!! @RawType GenericOut<Number> */
}
local /* final field */ val <$$delegate_0>: JRaw = j
@@ -153,6 +153,7 @@ object StandardClassIds {
val JvmDefault = "JvmDefault".jvmId()
val JvmRepeatable = "JvmRepeatable".jvmId()
val RawTypeAnnotation = "RawType".internalIrId()
val FlexibleNullability = "FlexibleNullability".internalIrId()
val EnhancedNullability = "EnhancedNullability".jvmInternalId()