to avoid unnecessarily loading unchanged ones.
Duplicate classes will make this a bit tricky. This commit outlines the
algorithm to handle them, the full implementation will follow later.
Also handle removed classes when computing classpath changes.
Test: New tests in ClasspathChangesComputerTest
In case of `inline fun <T : I<T>> foo(a: Any) = a as T` `T` is being
erased to `I<*>`
Also substitute class upper bound
Fix KT-47342
See KT-31072 for more details
`mappedVarargElements` are populated with parameters from
`argumentMapping`, which is computed using `ArgumentsToParametersMapper`
which calls `original` on all value parameters (see
ArgumentsToParametersMapper.kt:136).
So the code that adds empty lists for unassigned vararg parameters
should also call `original`. Otherwise, in the added test, we ended up
with two arguments for the parameter `s` in `id(::base1)`, one for
`Base.s` containing the correct value, and another for `Derived.s`
containing the empty list. Psi2ir took the last one, which resulted in
empty array being passed to the vararg parameter.
Note that all of this is caused by the fact that `original` of a fake
override parameter is the parameter of the base function. This seems
suspicious because `original` of a fake override _function_ is that fake
override itself (NOT the base function), but this would probably be very
risky to change at this point.
#KT-48835 Fixed
Parameter of a synthetic SAM adapter always has a function type (not a
subtype). Checking for the subtypes broke the case from KT-46908, where
fun interface is itself a subtype of a function type.
#KT-46908 Fixed
Since IDEA moved most of it's jars to java 11 it's illegal to use them
in our dependencies, so all modules which use `intellijDep()` should
carefully specify which jars they use
In case the cast value is used as a receiver to a private method call,
the cast is actually necessary, see KT-48927. Also, this optimization
has backfired once already (see kt48659_identityEqualsWithCastToAny.kt).
It seems that the best way to optimize these casts is not to generate
them in the first place, and/or use bytecode postprocessing.
Apparently the only kind of casts which need to be eliminated are those
which occur on an inline class to its supertype. Otherwise the
unsafe-coerce intrinsic is inserted at the incorrect place, and several
tests fail (uncastInlineClassToAnyAndBack.kt, genericOverride.kt,
classGenericOverride.kt).
#KT-48927 Fixed
This way caller don't need to first check if the symbol is allowed to
override. The current API throws for cases like Java field, or enum
entry, which is not very user-friendly.