hasSynthesizedParameterNames() pulled up into CallableDescriptor

This commit is contained in:
Andrey Breslav
2014-04-30 14:54:31 +04:00
parent 73cd776715
commit 775c941f8a
6 changed files with 31 additions and 1 deletions
@@ -19,5 +19,4 @@ package org.jetbrains.jet.lang.resolve.java.descriptor;
import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor;
public interface JavaCallableMemberDescriptor extends CallableMemberDescriptor {
boolean hasSynthesizedParameterNames();
}
@@ -51,8 +51,19 @@ public interface CallableDescriptor extends DeclarationDescriptorWithVisibility,
@NotNull
List<ValueParameterDescriptor> getValueParameters();
/**
* Kotlin functions always have stable parameter names that can be reliably used when calling them with named arguments.
* Functions loaded from platform definitions (e.g. Java binaries or JS) may have unstable parameter names that vary from
* one platform installation to another. These names can not be used reliably for calls with named arguments.
*/
boolean hasStableParameterNames();
/**
* Sometimes parameter names are not available at all (e.g. Java binaries with not enough debug information).
* In this case, getName() returns synthetic names such as "p0", "p1" etc.
*/
boolean hasSynthesizedParameterNames();
// Workaround for KT-4609 Wildcard types (super/extends) shouldn't be loaded as nullable
@KotlinSignature("fun getOverriddenDescriptors(): Set<out CallableDescriptor>")
@NotNull
@@ -87,6 +87,11 @@ public abstract class AbstractReceiverParameterDescriptor extends DeclarationDes
return false;
}
@Override
public boolean hasSynthesizedParameterNames() {
return false;
}
@NotNull
@Override
public Set<? extends CallableDescriptor> getOverriddenDescriptors() {
@@ -159,6 +159,11 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
return true;
}
@Override
public boolean hasSynthesizedParameterNames() {
return false;
}
@Override
public JetType getReturnType() {
return unsubstitutedReturnType;
@@ -89,6 +89,11 @@ public abstract class PropertyAccessorDescriptorImpl extends DeclarationDescript
return false;
}
@Override
public boolean hasSynthesizedParameterNames() {
return false;
}
@NotNull
@Override
public Modality getModality() {
@@ -85,6 +85,11 @@ public abstract class VariableDescriptorImpl extends DeclarationDescriptorNonRoo
return false;
}
@Override
public boolean hasSynthesizedParameterNames() {
return false;
}
@NotNull
@Override
public Set<? extends CallableDescriptor> getOverriddenDescriptors() {