[NI] Fix determining type equality in replacing of extension receiver

This commit is contained in:
Dmitriy Novozhilov
2019-04-19 13:48:07 +03:00
parent 0739d13038
commit f9cc3d9be3
2 changed files with 2 additions and 6 deletions
@@ -206,9 +206,8 @@ class ResolvedAtomCompleter(
val valueType = receiver.value.type.unwrap()
val newValueType = resultSubstitutor.substituteKeepAnnotations(valueType)
val newReceiverValue = receiver.value.replaceType(newValueType)
if (newReceiverValue != receiver.value) {
if (valueType !== newValueType) {
val newReceiverValue = receiver.value.replaceType(newValueType)
functionDescriptor.setExtensionReceiverParameter(
ReceiverParameterDescriptorImpl(receiver.containingDeclaration, newReceiverValue, receiver.annotations)
)
@@ -54,9 +54,6 @@ public class ExtensionReceiver extends AbstractReceiverValue implements Implicit
@NotNull
@Override
public ReceiverValue replaceType(@NotNull KotlinType newType) {
if (NewKotlinTypeChecker.INSTANCE.equalTypes(receiverType, newType)) {
return this;
}
return new ExtensionReceiver(descriptor, newType, getOriginal());
}