org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty.kt Maven / Gradle / Ivy
/*
* 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.fir.declarations.synthetic
import org.jetbrains.kotlin.KtSourceElement
import org.jetbrains.kotlin.fir.FirModuleData
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.expressions.FirExpression
import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference
import org.jetbrains.kotlin.fir.symbols.impl.FirDelegateFieldSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirSyntheticPropertySymbol
import org.jetbrains.kotlin.fir.types.ConeSimpleKotlinType
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.fir.visitors.FirTransformer
import org.jetbrains.kotlin.fir.visitors.FirVisitor
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
class FirSyntheticProperty(
override val moduleData: FirModuleData,
override val name: Name,
override val isVar: Boolean,
override val symbol: FirSyntheticPropertySymbol,
override val status: FirDeclarationStatus,
resolvePhase: FirResolvePhase,
override val getter: FirSyntheticPropertyAccessor,
override val setter: FirSyntheticPropertyAccessor? = null,
override val backingField: FirBackingField? = null,
override val deprecationsProvider: DeprecationsProvider = UnresolvedDeprecationProvider
) : FirProperty() {
init {
symbol.bind(this)
}
init {
@OptIn(ResolveStateAccess::class)
this.resolveState = resolvePhase.asResolveState()
}
override val returnTypeRef: FirTypeRef
get() = getter.returnTypeRef
override val dispatchReceiverType: ConeSimpleKotlinType?
get() = getter.dispatchReceiverType
override val source: KtSourceElement?
get() = null
override val origin: FirDeclarationOrigin
get() = FirDeclarationOrigin.Synthetic.JavaProperty
override val initializer: FirExpression?
get() = null
override val delegate: FirExpression?
get() = null
override val delegateFieldSymbol: FirDelegateFieldSymbol?
get() = null
override val isLocal: Boolean
get() = false
override val receiverParameter: FirReceiverParameter?
get() = null
override val isVal: Boolean
get() = !isVar
override val annotations: List
get() = emptyList()
override val typeParameters: List
get() = emptyList()
override val containerSource: DeserializedContainerSource?
get() = null
override val controlFlowGraphReference: FirControlFlowGraphReference? = null
override val attributes: FirDeclarationAttributes = FirDeclarationAttributes()
override val bodyResolveState: FirPropertyBodyResolveState
get() = FirPropertyBodyResolveState.EVERYTHING_RESOLVED
override val contextReceivers: List
get() = emptyList()
override fun acceptChildren(visitor: FirVisitor, data: D) {
returnTypeRef.accept(visitor, data)
status.accept(visitor, data)
}
override fun transformChildren(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformReturnTypeRef(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformReceiverParameter(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformStatus(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformOtherChildren(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformInitializer(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformGetter(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformSetter(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformBackingField(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformDelegate(transformer: FirTransformer, data: D): FirProperty {
notSupported()
}
override fun transformAnnotations(transformer: FirTransformer, data: D): FirSyntheticProperty {
notSupported()
}
override fun transformTypeParameters(transformer: FirTransformer, data: D): FirProperty {
notSupported()
}
override fun transformContextReceivers(transformer: FirTransformer, data: D): FirProperty {
notSupported()
}
override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) {
notSupported()
}
override fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?) {
notSupported()
}
override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider) {
notSupported()
}
override fun replaceControlFlowGraphReference(newControlFlowGraphReference: FirControlFlowGraphReference?) {
notSupported()
}
override fun replaceInitializer(newInitializer: FirExpression?) {
notSupported()
}
override fun replaceDelegate(newDelegate: FirExpression?) {
notSupported()
}
override fun replaceBodyResolveState(newBodyResolveState: FirPropertyBodyResolveState) {
notSupported()
}
override fun replaceGetter(newGetter: FirPropertyAccessor?) {
notSupported()
}
override fun replaceSetter(newSetter: FirPropertyAccessor?) {
notSupported()
}
override fun replaceContextReceivers(newContextReceivers: List) {
notSupported()
}
override fun replaceAnnotations(newAnnotations: List) {
notSupported()
}
override fun replaceStatus(newStatus: FirDeclarationStatus) {
notSupported()
}
private fun notSupported(): Nothing {
error("Transformation of synthetic property isn't supported")
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy