K2: Fix bounds erasure for raw types

Basically, this commit reworks eraseToUpperBound* stuff
Instead of a bunch of vague flags, we introduce two modes
(rawTypes/intersection emptiness checker) which defined those flags.

Also, it makes choosing `eraseArgumentsDeeply` option always because
that how it works in K1 and also use invariant projection inside
`eraseArgumentsDeeply` for raw types for the same reason.

^KT-57198 Fixed
This commit is contained in:
Denis.Zharkov
2023-03-16 16:54:16 +01:00
committed by Space Team
parent b0de442d76
commit 38138bf079
11 changed files with 72 additions and 42 deletions
@@ -1,10 +1,10 @@
public open class RawSuperTypeWithRecursiveBoundMultipleParameters : R|kotlin/Any| {
public constructor(): R|test/RawSuperTypeWithRecursiveBoundMultipleParameters|
public open inner class Derived : R|kotlin/Any|, R|Raw type test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>>| {
public open inner class Derived : R|kotlin/Any|, R|Raw type test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, *>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, *>?>>| {
public open fun foo(o: R|kotlin/Any!|, o1: R|kotlin/Any!|): R|kotlin/Unit|
@R|java/lang/Override|() public open fun foo(r: R|kotlin/Any!|, t: R|ft<Raw type test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>|): R|kotlin/Unit|
@R|java/lang/Override|() public open fun foo(r: R|kotlin/Any!|, t: R|ft<Raw type test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, *>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, *>?>>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>|): R|kotlin/Unit|
@R|java/lang/Override|() public open fun dummy(): R|kotlin/Unit|