Restore binary compatibility with android.nav.safearg plugin

In recent a39fbd3822 commit
contextReceiverParameters was introduced and new parameter to descriptor
methods was added. Luckily, it is low-level methods enough -- i.e.
they related to new descriptor creation, but still, some compatibility
is broken. This commit fixes usages in the android.nav.safearg that I
have found in the IDEA repo, maybe we will find other after some
compatibility testing.
This commit is contained in:
Stanislav Erokhin
2021-12-08 14:59:07 +01:00
committed by Space
parent f4830716bc
commit 255bbbbfa8
2 changed files with 28 additions and 0 deletions
@@ -120,6 +120,17 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
return setter != null ? setter.getValueParameters().get(0).getType() : null;
}
@kotlin.Deprecated(message = "This method is left for binary compatibility with android.nav.safearg plugin. Used in SafeArgSyntheticDescriptorGenerator.kt")
public void setType(
@NotNull KotlinType outType,
@ReadOnly @NotNull List<? extends TypeParameterDescriptor> typeParameters,
@Nullable ReceiverParameterDescriptor dispatchReceiverParameter,
@Nullable ReceiverParameterDescriptor extensionReceiverParameter
) {
setType(outType, typeParameters, dispatchReceiverParameter, extensionReceiverParameter,
Collections.<ReceiverParameterDescriptor>emptyList());
}
public void setType(
@NotNull KotlinType outType,
@ReadOnly @NotNull List<? extends TypeParameterDescriptor> typeParameters,
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.descriptors.impl;
import kotlin.DeprecationLevel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.*;
@@ -23,6 +24,7 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.types.KotlinType;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -50,6 +52,21 @@ public class SimpleFunctionDescriptorImpl extends FunctionDescriptorImpl impleme
return new SimpleFunctionDescriptorImpl(containingDeclaration, null, annotations, name, kind, source);
}
@NotNull
@kotlin.Deprecated(message = "This method is left for binary compatibility with android.nav.safearg plugin. Used in SafeArgSyntheticDescriptorGenerator.kt")
public SimpleFunctionDescriptorImpl initialize(
@Nullable ReceiverParameterDescriptor extensionReceiverParameter,
@Nullable ReceiverParameterDescriptor dispatchReceiverParameter,
@NotNull List<? extends TypeParameterDescriptor> typeParameters,
@NotNull List<ValueParameterDescriptor> unsubstitutedValueParameters,
@Nullable KotlinType unsubstitutedReturnType,
@Nullable Modality modality,
@NotNull DescriptorVisibility visibility
) {
return initialize(extensionReceiverParameter, dispatchReceiverParameter, Collections.<ReceiverParameterDescriptor>emptyList(),
typeParameters, unsubstitutedValueParameters, unsubstitutedReturnType, modality, visibility, null);
}
@NotNull
@Override
public SimpleFunctionDescriptorImpl initialize(