org.jetbrains.kotlin.descriptors.impl
Class FunctionDescriptorImpl

java.lang.Object
  extended by org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl
      extended by org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl
          extended by org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorNonRootImpl
              extended by 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


Nested Class Summary
 class FunctionDescriptorImpl.CopyConfiguration
           
 
Nested classes/interfaces inherited from interface org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
CallableMemberDescriptor.Kind
 
Constructor Summary
protected FunctionDescriptorImpl(DeclarationDescriptor containingDeclaration, FunctionDescriptor original, Annotations annotations, Name name, CallableMemberDescriptor.Kind kind, SourceElement source)
           
 
Method Summary
<R,D> R
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(FunctionDescriptorImpl.CopyConfiguration configuration)
           
 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 isHiddenToOvercomeSignatureClash()
           
 boolean isInfix()
           
 boolean isInline()
           
 boolean isOperator()
           
 boolean isTailrec()
           
 FunctionDescriptorImpl.CopyConfiguration newCopyBuilder()
           
 void setExternal(boolean isExternal)
           
 void setHasStableParameterNames(boolean hasStableParameterNames)
           
 void setHasSynthesizedParameterNames(boolean hasSynthesizedParameterNames)
           
 void setHidden(boolean hidden)
           
 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 org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorNonRootImpl
getContainingDeclaration, getSource
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl
acceptVoid, getName, toString, toString
 
Methods inherited from class org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl
getAnnotations
 
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.FunctionDescriptor
copy, getContainingDeclaration
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
getSource
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptor
acceptVoid
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.annotations.Annotated
getAnnotations
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.Named
getName
 

Constructor Detail

FunctionDescriptorImpl

protected FunctionDescriptorImpl(@NotNull
                                 DeclarationDescriptor containingDeclaration,
                                 @Nullable
                                 FunctionDescriptor original,
                                 @NotNull
                                 Annotations annotations,
                                 @NotNull
                                 Name name,
                                 @NotNull
                                 CallableMemberDescriptor.Kind kind,
                                 @NotNull
                                 SourceElement source)
Method Detail

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)

setHidden

public void setHidden(boolean hidden)

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

isHiddenToOvercomeSignatureClash

public boolean isHiddenToOvercomeSignatureClash()
Specified by:
isHiddenToOvercomeSignatureClash in interface FunctionDescriptor
Returns:
true if descriptor signature clashed with some other signature and it's supposed to be legal See java.nio.CharBuffer

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

getExtensionReceiverParameterType

@Nullable
protected KotlinType getExtensionReceiverParameterType()

newCopyBuilder

@NotNull
public FunctionDescriptorImpl.CopyConfiguration newCopyBuilder()

doSubstitute

@Nullable
protected FunctionDescriptor doSubstitute(@NotNull
                                                   FunctionDescriptorImpl.CopyConfiguration configuration)

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
Returns:
descriptor that represents initial signature, e.g in case of result SimpleFunctionDescriptor.createRenamedCopy it returns descriptor before rename

setInitialSignatureDescriptor

public void setInitialSignatureDescriptor(@Nullable
                                          FunctionDescriptor initialSignatureDescriptor)