Don't use methods from super interface if call was on inline class type

Some methods (like `size` from kotlin.collections.Collection) have
 special rules for mapping and overriding. For example, when we call
 `size`, normally there will be `INVOKEVIRTUAL size()` in the bytecode,
 but for inline classes it should be `INVOKESTATIC ...$Erased.getSize()`
This commit is contained in:
Mikhail Zarechenskiy
2018-06-14 18:18:47 +03:00
parent 246d5e294c
commit c5160a6a95
7 changed files with 47 additions and 1 deletions
@@ -881,7 +881,7 @@ public class KotlinTypeMapper {
FunctionDescriptor overriddenSpecialBuiltinFunction =
SpecialBuiltinMembers.getOverriddenBuiltinReflectingJvmDescriptor(functionDescriptor.getOriginal());
FunctionDescriptor functionToCall = overriddenSpecialBuiltinFunction != null && !superCall
FunctionDescriptor functionToCall = overriddenSpecialBuiltinFunction != null && !superCall && !toInlinedErasedClass
? overriddenSpecialBuiltinFunction.getOriginal()
: functionDescriptor.getOriginal();