Fix boxing/unboxing for generic functions on index expressions
Unsubstituted type should be used for coercion to box value of inline class type if it's needed. For the substituted value it's not known if it was a generic parameter or not. #KT-27502 Fixed
This commit is contained in:
@@ -4370,8 +4370,8 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
Type elementType = isGetter ? callableMethod.getReturnType() : ArrayUtil.getLastElement(argumentTypes);
|
||||
KotlinType elementKotlinType = isGetter ?
|
||||
operationDescriptor.getReturnType() :
|
||||
CollectionsKt.last(operationDescriptor.getValueParameters()).getType();
|
||||
operationDescriptor.getOriginal().getReturnType() :
|
||||
CollectionsKt.last(operationDescriptor.getOriginal().getValueParameters()).getType();
|
||||
return StackValue.collectionElement(
|
||||
collectionElementReceiver, elementType, elementKotlinType, resolvedGetCall, resolvedSetCall, this
|
||||
);
|
||||
|
||||
@@ -1449,7 +1449,7 @@ public abstract class StackValue {
|
||||
|
||||
Type lastParameterType = ArraysKt.last(setter.getParameterTypes());
|
||||
KotlinType lastParameterKotlinType =
|
||||
CollectionsKt.last(resolvedSetCall.getResultingDescriptor().getValueParameters()).getType();
|
||||
CollectionsKt.last(resolvedSetCall.getResultingDescriptor().getOriginal().getValueParameters()).getType();
|
||||
|
||||
coerce(topOfStackType, topOfStackKotlinType, lastParameterType, lastParameterKotlinType, v);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user