.kotlin.kotlin-compiler.1.3.11.source-code.ErrorSimpleFunctionDescriptorImpl Maven / Gradle / Ivy
/*
* Copyright 2010-2018 JetBrains s.r.o. 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.types.error;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
import org.jetbrains.kotlin.descriptors.impl.FunctionDescriptorImpl;
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.types.ErrorUtils;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.TypeSubstitution;
import java.util.Collection;
import java.util.List;
public class ErrorSimpleFunctionDescriptorImpl extends SimpleFunctionDescriptorImpl {
// used for diagnostic only
@SuppressWarnings({"UnusedDeclaration", "FieldCanBeLocal"})
private final ErrorUtils.ErrorScope ownerScope;
public ErrorSimpleFunctionDescriptorImpl(@NotNull ClassDescriptor containingDeclaration, @NotNull ErrorUtils.ErrorScope ownerScope) {
super(containingDeclaration, null, Annotations.Companion.getEMPTY(), Name.special(""), Kind.DECLARATION, SourceElement.NO_SOURCE);
this.ownerScope = ownerScope;
}
@NotNull
@Override
protected FunctionDescriptorImpl createSubstitutedCopy(
@NotNull DeclarationDescriptor newOwner,
@Nullable FunctionDescriptor original,
@NotNull Kind kind,
@Nullable Name newName,
@NotNull Annotations annotations,
@NotNull SourceElement source
) {
return this;
}
@NotNull
@Override
public SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, Visibility visibility, Kind kind, boolean copyOverrides) {
return this;
}
@NotNull
@Override
public CopyBuilder newCopyBuilder() {
return new CopyBuilder() {
@NotNull
@Override
public CopyBuilder setOwner(@NotNull DeclarationDescriptor owner) {
return this;
}
@NotNull
@Override
public CopyBuilder setModality(@NotNull Modality modality) {
return this;
}
@NotNull
@Override
public CopyBuilder setVisibility(@NotNull Visibility visibility) {
return this;
}
@NotNull
@Override
public CopyBuilder setKind(@NotNull Kind kind) {
return this;
}
@NotNull
@Override
public CopyBuilder setCopyOverrides(boolean copyOverrides) {
return this;
}
@NotNull
@Override
public CopyBuilder setName(@NotNull Name name) {
return this;
}
@NotNull
@Override
public CopyBuilder setValueParameters(@NotNull List parameters) {
return this;
}
@NotNull
@Override
public CopyBuilder setSubstitution(@NotNull TypeSubstitution substitution) {
return this;
}
@NotNull
@Override
public CopyBuilder putUserData(
@NotNull UserDataKey userDataKey,
V value
) {
return this;
}
@NotNull
@Override
public CopyBuilder setTypeParameters(@NotNull List parameters) {
return this;
}
@NotNull
@Override
public CopyBuilder setReturnType(@NotNull KotlinType type) {
return this;
}
@NotNull
@Override
public CopyBuilder setExtensionReceiverParameter(@Nullable ReceiverParameterDescriptor extensionReceiverParameter) {
return this;
}
@NotNull
@Override
public CopyBuilder setDispatchReceiverParameter(@Nullable ReceiverParameterDescriptor dispatchReceiverParameter) {
return this;
}
@NotNull
@Override
public CopyBuilder setOriginal(@Nullable CallableMemberDescriptor original) {
return this;
}
@NotNull
@Override
public CopyBuilder setSignatureChange() {
return this;
}
@NotNull
@Override
public CopyBuilder setPreserveSourceElement() {
return this;
}
@NotNull
@Override
public CopyBuilder setDropOriginalInContainingParts() {
return this;
}
@NotNull
@Override
public CopyBuilder setHiddenToOvercomeSignatureClash() {
return this;
}
@NotNull
@Override
public CopyBuilder setHiddenForResolutionEverywhereBesideSupercalls() {
return this;
}
@NotNull
@Override
public CopyBuilder setAdditionalAnnotations(@NotNull Annotations additionalAnnotations) {
return this;
}
@Nullable
@Override
public SimpleFunctionDescriptor build() {
return ErrorSimpleFunctionDescriptorImpl.this;
}
};
}
@Override
public boolean isSuspend() {
return false;
}
@Override
public V getUserData(UserDataKey key) {
return null;
}
@Override
public void setOverriddenDescriptors(@NotNull Collection overriddenDescriptors) {
// nop
}
}