All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlin.ir.symbols.impl.IrFakeOverrideSymbol.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-RC
Show newest version
/*
 * Copyright 2010-2023 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.ir.symbols.impl

import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.IrField
import org.jetbrains.kotlin.ir.declarations.IrProperty
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.symbols.*
import org.jetbrains.kotlin.ir.util.IdSignature
import org.jetbrains.kotlin.utils.addToStdlib.shouldNotBeCalled

abstract class IrFakeOverrideSymbolBase, I : IrDeclaration, D : CallableDescriptor>(
    val originalSymbol: S,
    val containingClassSymbol: IrClassSymbol,
    override val signature: IdSignature?
) : IrBindableSymbol {
    @ObsoleteDescriptorBasedAPI
    override val hasDescriptor: Boolean
        get() = false

    override val isBound: Boolean
        get() = false

    override var privateSignature: IdSignature?
        get() = shouldNotBeCalled()
        set(_) {
            shouldNotBeCalled()
        }

    @UnsafeDuringIrConstructionAPI
    @Deprecated("Fake-override symbols never has its owner", level = DeprecationLevel.HIDDEN)
    override val owner: I
        get() = shouldNotBeCalled()

    @ObsoleteDescriptorBasedAPI
    @Deprecated("Fake-override symbols never has its owner", level = DeprecationLevel.HIDDEN)
    override val descriptor: D
        get() = shouldNotBeCalled()

    @Deprecated("Fake-override symbols never has its owner", level = DeprecationLevel.HIDDEN)
    override fun bind(owner: I) {
        shouldNotBeCalled()
    }
}

class IrFunctionFakeOverrideSymbol(
    originalSymbol: IrSimpleFunctionSymbol,
    containingClassSymbol: IrClassSymbol,
    idSignature: IdSignature?
) : IrFakeOverrideSymbolBase(
    originalSymbol, containingClassSymbol, idSignature
), IrSimpleFunctionSymbol

class IrPropertyFakeOverrideSymbol(
    originalSymbol: IrPropertySymbol,
    containingClassSymbol: IrClassSymbol,
    idSignature: IdSignature?
) : IrFakeOverrideSymbolBase(
    originalSymbol, containingClassSymbol, idSignature
), IrPropertySymbol

class IrFieldFakeOverrideSymbol(
    originalSymbol: IrFieldSymbol,
    containingClassSymbol: IrClassSymbol,
    idSignature: IdSignature?,
    val correspondingPropertySymbol: IrPropertySymbol
) : IrFakeOverrideSymbolBase(
    originalSymbol, containingClassSymbol, idSignature
), IrFieldSymbol




© 2015 - 2024 Weber Informatics LLC | Privacy Policy