ee8d42532b
We don't have true flexible types in the IR, but we approximate it with internal type annotations, such as FlexibleNullability, FlexibleMutability, RawType. These annotations are then handled specially in JvmIrTypeSystemContext, which can construct a fake flexible type so that type checker on IR types would behave exactly as on frontend types. As shown in KT-63441, one instance of flexible types where flexibility was lost during conversion to IR is Java array/vararg types. It's necessary to support it so that IR fake overrides could be constructed correctly, because IR fake override checker requires parameter types to be equal. So this change introduces another internal type annotation, FlexibleArrayElementVariance, which is only applicable to types with classifier kotlin/Array, and which signifies that the annotated type `Array<X>` should rather be seen as `Array<X>..Array<out X>`. #KT-63441 Fixed #KT-63446 Fixed
10 lines
1.2 KiB
Plaintext
Vendored
10 lines
1.2 KiB
Plaintext
Vendored
FILE fqName:<root> fileName:/jdkClassSyntheticProperty.kt
|
|
PROPERTY name:test visibility:public modality:FINAL [val]
|
|
FUN name:<get-test> visibility:public modality:FINAL <> ($receiver:java.lang.Class<*>) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array<out @[FlexibleNullability] java.lang.reflect.Field?>?
|
|
correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val]
|
|
$receiver: VALUE_PARAMETER name:<this> type:java.lang.Class<*>
|
|
BLOCK_BODY
|
|
RETURN type=kotlin.Nothing from='public final fun <get-test> (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array<out @[FlexibleNullability] java.lang.reflect.Field?>? declared in <root>'
|
|
CALL 'public open fun getDeclaredFields (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array<out @[FlexibleNullability] java.lang.reflect.Field?>? declared in java.lang.Class' type=@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array<out @[FlexibleNullability] java.lang.reflect.Field?>? origin=GET_PROPERTY
|
|
$this: GET_VAR '<this>: java.lang.Class<*> declared in <root>.<get-test>' type=java.lang.Class<*> origin=null
|