@Nullable static OverrideCompatibilityInfo checkReceiverAndParameterCount( CallableDescriptor superDescriptor, CallableDescriptor subDescriptor) { if ((superDescriptor.getExtensionReceiverParameter() == null) != (subDescriptor.getExtensionReceiverParameter() == null)) { return OverrideCompatibilityInfo.incompatible("Receiver presence mismatch"); } if (superDescriptor.getValueParameters().size() != subDescriptor.getValueParameters().size()) { return OverrideCompatibilityInfo.incompatible("Value parameter number mismatch"); } return null; }
@Nullable static OverrideCompatibilityInfo checkReceiverAndParameterCount( CallableDescriptor superDescriptor, CallableDescriptor subDescriptor) { if ((superDescriptor.getExtensionReceiverParameter() == null) != (subDescriptor.getExtensionReceiverParameter() == null)) { return OverrideCompatibilityInfo.receiverPresenceMismatch(); } if (superDescriptor.getValueParameters().size() != subDescriptor.getValueParameters().size()) { return OverrideCompatibilityInfo.valueParameterNumberMismatch(); } return null; }
static List<KotlinType> compiledValueParameters(CallableDescriptor callableDescriptor) { ReceiverParameterDescriptor receiverParameter = callableDescriptor.getExtensionReceiverParameter(); List<KotlinType> parameters = new ArrayList<KotlinType>(); if (receiverParameter != null) { parameters.add(receiverParameter.getType()); } for (ValueParameterDescriptor valueParameterDescriptor : callableDescriptor.getValueParameters()) { parameters.add(valueParameterDescriptor.getType()); } return parameters; }
public static boolean isExtension(@NotNull CallableDescriptor descriptor) { return (descriptor.getExtensionReceiverParameter() != null); }