org.jetbrains.kotlin.descriptors.impl
Class FunctionDescriptorImpl
java.lang.Object
org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl
org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl
org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorNonRootImpl
org.jetbrains.kotlin.descriptors.impl.FunctionDescriptorImpl
- All Implemented Interfaces:
- Annotated, CallableDescriptor, CallableMemberDescriptor, DeclarationDescriptor, DeclarationDescriptorNonRoot, DeclarationDescriptorWithSource, DeclarationDescriptorWithVisibility, FunctionDescriptor, MemberDescriptor, Named
- Direct Known Subclasses:
- ConstructorDescriptorImpl, SimpleFunctionDescriptorImpl
public abstract class FunctionDescriptorImpl
- extends DeclarationDescriptorNonRootImpl
- implements FunctionDescriptor
Method Summary |
|
accept(DeclarationDescriptorVisitor<R,D> visitor,
D data)
|
void |
addOverriddenDescriptor(CallableMemberDescriptor overriddenFunction)
|
protected abstract FunctionDescriptorImpl |
createSubstitutedCopy(DeclarationDescriptor newOwner,
FunctionDescriptor original,
CallableMemberDescriptor.Kind kind,
Name newName,
boolean preserveSource)
|
protected FunctionDescriptor |
doSubstitute(TypeSubstitutor originalSubstitutor,
DeclarationDescriptor newOwner,
Modality newModality,
Visibility newVisibility,
boolean isOperator,
boolean isInfix,
boolean isExternal,
boolean isInline,
boolean isTailrec,
boolean hasStableParameterNames,
boolean hasSynthesizedParameterNames,
FunctionDescriptor original,
boolean copyOverrides,
CallableMemberDescriptor.Kind kind)
|
protected FunctionDescriptor |
doSubstitute(TypeSubstitutor originalSubstitutor,
DeclarationDescriptor newOwner,
Modality newModality,
Visibility newVisibility,
boolean isOperator,
boolean isInfix,
boolean isExternal,
boolean isInline,
boolean isTailrec,
boolean hasStableParameterNames,
boolean hasSynthesizedParameterNames,
FunctionDescriptor original,
boolean copyOverrides,
CallableMemberDescriptor.Kind kind,
java.util.List<ValueParameterDescriptor> newValueParameterDescriptors,
KotlinType newExtensionReceiverParameterType,
KotlinType newReturnType,
Name name,
boolean preserveSource,
boolean signatureChange)
|
ReceiverParameterDescriptor |
getDispatchReceiverParameter()
|
ReceiverParameterDescriptor |
getExtensionReceiverParameter()
|
protected KotlinType |
getExtensionReceiverParameterType()
|
FunctionDescriptor |
getInitialSignatureDescriptor()
|
CallableMemberDescriptor.Kind |
getKind()
Is this a real function or function projection. |
Modality |
getModality()
|
FunctionDescriptor |
getOriginal()
|
java.util.Collection<? extends FunctionDescriptor> |
getOverriddenDescriptors()
|
KotlinType |
getReturnType()
Method may return null for not yet fully initialized object or if error occurred. |
protected SourceElement |
getSourceToUseForCopy(boolean preserveSource,
FunctionDescriptor original)
|
static java.util.List<ValueParameterDescriptor> |
getSubstitutedValueParameters(FunctionDescriptor substitutedDescriptor,
java.util.List<ValueParameterDescriptor> unsubstitutedValueParameters,
TypeSubstitutor substitutor)
|
java.util.List<TypeParameterDescriptor> |
getTypeParameters()
|
java.util.List<ValueParameterDescriptor> |
getValueParameters()
|
Visibility |
getVisibility()
|
boolean |
hasStableParameterNames()
Kotlin functions always have stable parameter names that can be reliably used when calling them with named arguments. |
boolean |
hasSynthesizedParameterNames()
Sometimes parameter names are not available at all (e.g. |
FunctionDescriptorImpl |
initialize(KotlinType receiverParameterType,
ReceiverParameterDescriptor dispatchReceiverParameter,
java.util.List<? extends TypeParameterDescriptor> typeParameters,
java.util.List<ValueParameterDescriptor> unsubstitutedValueParameters,
KotlinType unsubstitutedReturnType,
Modality modality,
Visibility visibility)
|
boolean |
isExternal()
|
boolean |
isInfix()
|
boolean |
isInline()
|
boolean |
isOperator()
|
boolean |
isTailrec()
|
void |
setExternal(boolean isExternal)
|
void |
setHasStableParameterNames(boolean hasStableParameterNames)
|
void |
setHasSynthesizedParameterNames(boolean hasSynthesizedParameterNames)
|
void |
setInfix(boolean isInfix)
|
void |
setInitialSignatureDescriptor(FunctionDescriptor initialSignatureDescriptor)
|
void |
setInline(boolean isInline)
|
void |
setOperator(boolean isOperator)
|
void |
setReturnType(KotlinType unsubstitutedReturnType)
|
void |
setTailrec(boolean isTailrec)
|
void |
setVisibility(Visibility visibility)
|
FunctionDescriptor |
substitute(TypeSubstitutor originalSubstitutor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jetbrains.kotlin.descriptors.Named |
getName |
FunctionDescriptorImpl
protected FunctionDescriptorImpl(@NotNull
DeclarationDescriptor containingDeclaration,
@Nullable
FunctionDescriptor original,
@NotNull
Annotations annotations,
@NotNull
Name name,
@NotNull
CallableMemberDescriptor.Kind kind,
@NotNull
SourceElement source)
initialize
@NotNull
public FunctionDescriptorImpl initialize(@Nullable
KotlinType receiverParameterType,
@Nullable
ReceiverParameterDescriptor dispatchReceiverParameter,
@NotNull
java.util.List<? extends TypeParameterDescriptor> typeParameters,
@NotNull
java.util.List<ValueParameterDescriptor> unsubstitutedValueParameters,
@Nullable
KotlinType unsubstitutedReturnType,
@Nullable
Modality modality,
@NotNull
Visibility visibility)
setVisibility
public void setVisibility(@NotNull
Visibility visibility)
setOperator
public void setOperator(boolean isOperator)
setInfix
public void setInfix(boolean isInfix)
setExternal
public void setExternal(boolean isExternal)
setInline
public void setInline(boolean isInline)
setTailrec
public void setTailrec(boolean isTailrec)
setReturnType
public void setReturnType(@NotNull
KotlinType unsubstitutedReturnType)
setHasStableParameterNames
public void setHasStableParameterNames(boolean hasStableParameterNames)
setHasSynthesizedParameterNames
public void setHasSynthesizedParameterNames(boolean hasSynthesizedParameterNames)
getExtensionReceiverParameter
@Nullable
public ReceiverParameterDescriptor getExtensionReceiverParameter()
- Specified by:
getExtensionReceiverParameter
in interface CallableDescriptor
getDispatchReceiverParameter
@Nullable
public ReceiverParameterDescriptor getDispatchReceiverParameter()
- Specified by:
getDispatchReceiverParameter
in interface CallableDescriptor
getOverriddenDescriptors
@NotNull
public java.util.Collection<? extends FunctionDescriptor> getOverriddenDescriptors()
- Specified by:
getOverriddenDescriptors
in interface CallableDescriptor
- Specified by:
getOverriddenDescriptors
in interface CallableMemberDescriptor
- Specified by:
getOverriddenDescriptors
in interface FunctionDescriptor
getModality
@NotNull
public Modality getModality()
- Specified by:
getModality
in interface MemberDescriptor
getVisibility
@NotNull
public Visibility getVisibility()
- Specified by:
getVisibility
in interface DeclarationDescriptorWithVisibility
- Specified by:
getVisibility
in interface MemberDescriptor
isOperator
public boolean isOperator()
- Specified by:
isOperator
in interface FunctionDescriptor
isInfix
public boolean isInfix()
- Specified by:
isInfix
in interface FunctionDescriptor
isExternal
public boolean isExternal()
- Specified by:
isExternal
in interface FunctionDescriptor
isInline
public boolean isInline()
- Specified by:
isInline
in interface FunctionDescriptor
isTailrec
public boolean isTailrec()
- Specified by:
isTailrec
in interface FunctionDescriptor
addOverriddenDescriptor
public void addOverriddenDescriptor(@NotNull
CallableMemberDescriptor overriddenFunction)
- Specified by:
addOverriddenDescriptor
in interface CallableMemberDescriptor
getTypeParameters
@NotNull
public java.util.List<TypeParameterDescriptor> getTypeParameters()
- Specified by:
getTypeParameters
in interface CallableDescriptor
getValueParameters
@NotNull
public java.util.List<ValueParameterDescriptor> getValueParameters()
- Specified by:
getValueParameters
in interface CallableDescriptor
hasStableParameterNames
public boolean hasStableParameterNames()
- Description copied from interface:
CallableDescriptor
- 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.
- Specified by:
hasStableParameterNames
in interface CallableDescriptor
hasSynthesizedParameterNames
public boolean hasSynthesizedParameterNames()
- Description copied from interface:
CallableDescriptor
- 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.
- Specified by:
hasSynthesizedParameterNames
in interface CallableDescriptor
getReturnType
public KotlinType getReturnType()
- Description copied from interface:
CallableDescriptor
- Method may return null for not yet fully initialized object or if error occurred.
- Specified by:
getReturnType
in interface CallableDescriptor
getOriginal
@NotNull
public FunctionDescriptor getOriginal()
- Specified by:
getOriginal
in interface CallableDescriptor
- Specified by:
getOriginal
in interface CallableMemberDescriptor
- Specified by:
getOriginal
in interface DeclarationDescriptor
- Specified by:
getOriginal
in interface DeclarationDescriptorWithSource
- Specified by:
getOriginal
in interface FunctionDescriptor
- Overrides:
getOriginal
in class DeclarationDescriptorNonRootImpl
- Returns:
- The descriptor that corresponds to the original declaration of this element.
A descriptor can be obtained from its original by substituting type arguments (of the declaring class
or of the element itself).
returns
this
object if the current descriptor is original itself
getKind
@NotNull
public CallableMemberDescriptor.Kind getKind()
- Description copied from interface:
CallableMemberDescriptor
- Is this a real function or function projection.
- Specified by:
getKind
in interface CallableMemberDescriptor
substitute
public FunctionDescriptor substitute(@NotNull
TypeSubstitutor originalSubstitutor)
- Specified by:
substitute
in interface CallableDescriptor
- Specified by:
substitute
in interface DeclarationDescriptor
- Specified by:
substitute
in interface FunctionDescriptor
doSubstitute
@Nullable
protected FunctionDescriptor doSubstitute(@NotNull
TypeSubstitutor originalSubstitutor,
@NotNull
DeclarationDescriptor newOwner,
@NotNull
Modality newModality,
@NotNull
Visibility newVisibility,
boolean isOperator,
boolean isInfix,
boolean isExternal,
boolean isInline,
boolean isTailrec,
boolean hasStableParameterNames,
boolean hasSynthesizedParameterNames,
@Nullable
FunctionDescriptor original,
boolean copyOverrides,
@NotNull
CallableMemberDescriptor.Kind kind)
getExtensionReceiverParameterType
@Nullable
protected KotlinType getExtensionReceiverParameterType()
doSubstitute
@Nullable
protected FunctionDescriptor doSubstitute(@NotNull
TypeSubstitutor originalSubstitutor,
@NotNull
DeclarationDescriptor newOwner,
@NotNull
Modality newModality,
@NotNull
Visibility newVisibility,
boolean isOperator,
boolean isInfix,
boolean isExternal,
boolean isInline,
boolean isTailrec,
boolean hasStableParameterNames,
boolean hasSynthesizedParameterNames,
@Nullable
FunctionDescriptor original,
boolean copyOverrides,
@NotNull
CallableMemberDescriptor.Kind kind,
@NotNull
java.util.List<ValueParameterDescriptor> newValueParameterDescriptors,
@Nullable
KotlinType newExtensionReceiverParameterType,
@NotNull
KotlinType newReturnType,
@Nullable
Name name,
boolean preserveSource,
boolean signatureChange)
createSubstitutedCopy
@NotNull
protected abstract FunctionDescriptorImpl createSubstitutedCopy(@NotNull
DeclarationDescriptor newOwner,
@Nullable
FunctionDescriptor original,
@NotNull
CallableMemberDescriptor.Kind kind,
@Nullable
Name newName,
boolean preserveSource)
getSourceToUseForCopy
@NotNull
protected SourceElement getSourceToUseForCopy(boolean preserveSource,
@Nullable
FunctionDescriptor original)
accept
public <R,D> R accept(DeclarationDescriptorVisitor<R,D> visitor,
D data)
- Specified by:
accept
in interface DeclarationDescriptor
getSubstitutedValueParameters
@Nullable
public static java.util.List<ValueParameterDescriptor> getSubstitutedValueParameters(FunctionDescriptor substitutedDescriptor,
@NotNull
java.util.List<ValueParameterDescriptor> unsubstitutedValueParameters,
@NotNull
TypeSubstitutor substitutor)
getInitialSignatureDescriptor
@Nullable
public FunctionDescriptor getInitialSignatureDescriptor()
- Specified by:
getInitialSignatureDescriptor
in interface FunctionDescriptor
setInitialSignatureDescriptor
public void setInitialSignatureDescriptor(@Nullable
FunctionDescriptor initialSignatureDescriptor)