org.jetbrains.kotlin.descriptors.FunctionDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-compiler-embeddable Show documentation
Show all versions of kotlin-compiler-embeddable Show documentation
the Kotlin compiler embeddable
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.descriptors;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
import org.jetbrains.kotlin.mpp.FunctionSymbolMarker;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.TypeSubstitution;
import org.jetbrains.kotlin.types.TypeSubstitutor;
import java.util.Collection;
import java.util.List;
public interface FunctionDescriptor extends CallableMemberDescriptor, FunctionSymbolMarker {
@Override
@NotNull
DeclarationDescriptor getContainingDeclaration();
@NotNull
@Override
FunctionDescriptor getOriginal();
@Nullable
@Override
FunctionDescriptor substitute(@NotNull TypeSubstitutor substitutor);
/**
* This method should be used with a great care, because if descriptor is substituted one, calling 'getOverriddenDescriptors'
* may force lazy computation, that's unnecessary in most cases.
* So, if 'getOriginal().getOverriddenDescriptors()' is enough for you, please use it instead.
* @return
*/
@Override
@NotNull
Collection extends FunctionDescriptor> getOverriddenDescriptors();
/**
* @return descriptor that represents initial signature, e.g in case of result SimpleFunctionDescriptor.createRenamedCopy it returns
* descriptor before rename
*/
@Nullable
FunctionDescriptor getInitialSignatureDescriptor();
/**
* @return true if descriptor signature clashed with some other signature and it's supposed to be legal
* See java.nio.CharBuffer
*/
boolean isHiddenToOvercomeSignatureClash();
@NotNull
@Override
FunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, DescriptorVisibility visibility, Kind kind, boolean copyOverrides);
boolean isOperator();
boolean isInfix();
boolean isInline();
boolean isTailrec();
boolean isHiddenForResolutionEverywhereBesideSupercalls();
boolean isSuspend();
@NotNull
@Override
CopyBuilder extends FunctionDescriptor> newCopyBuilder();
interface CopyBuilder extends CallableMemberDescriptor.CopyBuilder {
@NotNull
@Override
CopyBuilder setOwner(@NotNull DeclarationDescriptor owner);
@NotNull
@Override
CopyBuilder setModality(@NotNull Modality modality);
@NotNull
@Override
CopyBuilder setVisibility(@NotNull DescriptorVisibility visibility);
@NotNull
@Override
CopyBuilder setKind(@NotNull Kind kind);
@NotNull
@Override
CopyBuilder setCopyOverrides(boolean copyOverrides);
@Override
@NotNull
CopyBuilder setName(@NotNull Name name);
@NotNull
CopyBuilder setValueParameters(@NotNull List parameters);
@NotNull
@Override
CopyBuilder setTypeParameters(@NotNull List parameters);
@NotNull
@Override
CopyBuilder setReturnType(@NotNull KotlinType type);
@NotNull
CopyBuilder setContextReceiverParameters(@NotNull List contextReceiverParameters);
@NotNull
CopyBuilder setExtensionReceiverParameter(@Nullable ReceiverParameterDescriptor extensionReceiverParameter);
@NotNull
@Override
CopyBuilder setDispatchReceiverParameter(@Nullable ReceiverParameterDescriptor dispatchReceiverParameter);
@NotNull
@Override
CopyBuilder setOriginal(@Nullable CallableMemberDescriptor original);
@NotNull
CopyBuilder setSignatureChange();
@NotNull
@Override
CopyBuilder setPreserveSourceElement();
@NotNull
CopyBuilder setDropOriginalInContainingParts();
@NotNull
CopyBuilder setHiddenToOvercomeSignatureClash();
@NotNull
CopyBuilder setHiddenForResolutionEverywhereBesideSupercalls();
@NotNull
CopyBuilder setAdditionalAnnotations(@NotNull Annotations additionalAnnotations);
@NotNull
@Override
CopyBuilder setSubstitution(@NotNull TypeSubstitution substitution);
@NotNull
CopyBuilder putUserData(@NotNull UserDataKey userDataKey, V value);
@Nullable
@Override
D build();
}
}