org.jetbrains.kotlin.descriptors.impl
Class VariableDescriptorImpl
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.VariableDescriptorImpl
- All Implemented Interfaces:
- Annotated, CallableDescriptor, DeclarationDescriptor, DeclarationDescriptorNonRoot, DeclarationDescriptorWithSource, DeclarationDescriptorWithVisibility, Named, VariableDescriptor
- Direct Known Subclasses:
- ValueParameterDescriptorImpl, VariableDescriptorWithInitializerImpl
public abstract class VariableDescriptorImpl
- extends DeclarationDescriptorNonRootImpl
- implements VariableDescriptor
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 |
outType
protected KotlinType outType
VariableDescriptorImpl
public VariableDescriptorImpl(@NotNull
DeclarationDescriptor containingDeclaration,
@NotNull
Annotations annotations,
@NotNull
Name name,
@Nullable
KotlinType outType,
@NotNull
SourceElement source)
getType
@NotNull
public KotlinType getType()
- Specified by:
getType
in interface VariableDescriptor
setOutType
public void setOutType(KotlinType outType)
getOriginal
@NotNull
public VariableDescriptor getOriginal()
- Specified by:
getOriginal
in interface CallableDescriptor
- Specified by:
getOriginal
in interface DeclarationDescriptor
- Specified by:
getOriginal
in interface DeclarationDescriptorWithSource
- 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
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
getOverriddenDescriptors
@NotNull
public java.util.Collection<? extends CallableDescriptor> getOverriddenDescriptors()
- Specified by:
getOverriddenDescriptors
in interface CallableDescriptor
getTypeParameters
@NotNull
public java.util.List<TypeParameterDescriptor> getTypeParameters()
- Specified by:
getTypeParameters
in interface CallableDescriptor
getExtensionReceiverParameter
public ReceiverParameterDescriptor getExtensionReceiverParameter()
- Specified by:
getExtensionReceiverParameter
in interface CallableDescriptor
getDispatchReceiverParameter
public ReceiverParameterDescriptor getDispatchReceiverParameter()
- Specified by:
getDispatchReceiverParameter
in interface CallableDescriptor
getReturnType
@NotNull
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
isConst
public boolean isConst()
- Specified by:
isConst
in interface VariableDescriptor
- Returns:
- true if iff original declaration has appropriate flags and type, e.g. `const` modifier in Kotlin.
It completely does not means that if isConst then `getCompileTimeInitializer` is not null