Fix type mapping for parameter of Collection<Int>::remove override
In the case the single parameter of override has `Integer` type instead of `int` type (while in common case it would be just `int`) See the comment inside forceSingleValueParameterBoxing for clarification #KT-19892 Fixed
This commit is contained in:
@@ -61,6 +61,7 @@ import org.jetbrains.kotlin.diagnostics.Errors;
|
||||
import org.jetbrains.kotlin.lexer.KtTokens;
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||
import org.jetbrains.kotlin.load.java.sam.SamConstructorDescriptor;
|
||||
import org.jetbrains.kotlin.load.kotlin.MethodSignatureMappingKt;
|
||||
import org.jetbrains.kotlin.load.kotlin.TypeSignatureMappingKt;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
@@ -1284,8 +1285,19 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
KotlinType varType = isDelegatedLocalVariable(variableDescriptor)
|
||||
? JvmCodegenUtil.getPropertyDelegateType((VariableDescriptorWithAccessors) variableDescriptor, bindingContext)
|
||||
: variableDescriptor.getType();
|
||||
//noinspection ConstantConditions
|
||||
return asmType(varType);
|
||||
|
||||
if (variableDescriptor instanceof ValueParameterDescriptor &&
|
||||
MethodSignatureMappingKt.forceSingleValueParameterBoxing(
|
||||
(CallableDescriptor) variableDescriptor.getContainingDeclaration()
|
||||
)
|
||||
) {
|
||||
//noinspection ConstantConditions
|
||||
return asmType(TypeUtils.makeNullable(varType));
|
||||
}
|
||||
else {
|
||||
//noinspection ConstantConditions
|
||||
return asmType(varType);
|
||||
}
|
||||
}
|
||||
|
||||
private void putDescriptorIntoFrameMap(@NotNull KtElement statement) {
|
||||
|
||||
Reference in New Issue
Block a user