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
4 lines
68 B
Kotlin
Vendored
4 lines
68 B
Kotlin
Vendored
fun foo(t: Throwable) {
|
|
t.setStackTrace(p0 = t.getStackTrace())
|
|
}
|