diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt index 85cbb3543fbe0..972451557f358 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt @@ -7,11 +7,8 @@ package org.jetbrains.kotlin.fir.java.scopes import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.* -import org.jetbrains.kotlin.fir.declarations.builder.FirSimpleFunctionBuilder -import org.jetbrains.kotlin.fir.declarations.builder.FirValueParameterBuilder import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty import org.jetbrains.kotlin.fir.declarations.synthetic.buildSyntheticProperty -import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.java.JavaTypeParameterStack import org.jetbrains.kotlin.fir.java.declarations.* import org.jetbrains.kotlin.fir.resolve.FirJavaSyntheticNamesProvider @@ -24,7 +21,6 @@ import org.jetbrains.kotlin.fir.scopes.impl.AbstractFirUseSiteMemberScope import org.jetbrains.kotlin.fir.symbols.CallableId import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.isUnit -import org.jetbrains.kotlin.fir.types.jvm.FirJavaTypeRef import org.jetbrains.kotlin.name.Name class JavaClassUseSiteMemberScope( @@ -132,32 +128,6 @@ class JavaClassUseSiteMemberScope( } } - override fun createFunctionCopy(firSimpleFunction: FirSimpleFunction, newSymbol: FirNamedFunctionSymbol): FirSimpleFunctionBuilder { - if (firSimpleFunction !is FirJavaMethod) return super.createFunctionCopy(firSimpleFunction, newSymbol) - return FirJavaMethodBuilder().apply { - session = firSimpleFunction.session - source = firSimpleFunction.source - symbol = newSymbol - name = firSimpleFunction.name - visibility = firSimpleFunction.visibility - modality = firSimpleFunction.modality - returnTypeRef = firSimpleFunction.returnTypeRef - isStatic = firSimpleFunction.status.isStatic - status = firSimpleFunction.status - } - } - - override fun createValueParameterCopy(parameter: FirValueParameter, newDefaultValue: FirExpression?): FirValueParameterBuilder { - if (parameter !is FirJavaValueParameter) return super.createValueParameterCopy(parameter, newDefaultValue) - return FirJavaValueParameterBuilder().apply { - session = parameter.session - source = parameter.source - name = parameter.name - returnTypeRef = parameter.returnTypeRef as FirJavaTypeRef - isVararg = parameter.isVararg - } - } - override fun processPropertiesByName(name: Name, processor: (FirVariableSymbol<*>) -> Unit) { // Do not generate accessors at all? if (name.isSpecial) { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirOverrideScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirOverrideScope.kt index 8b0618b7197e3..28fc28d6904cd 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirOverrideScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirOverrideScope.kt @@ -8,17 +8,12 @@ package org.jetbrains.kotlin.fir.scopes.impl import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.* -import org.jetbrains.kotlin.fir.declarations.builder.FirPropertyBuilder import org.jetbrains.kotlin.fir.declarations.builder.FirSimpleFunctionBuilder -import org.jetbrains.kotlin.fir.declarations.builder.FirValueParameterBuilder -import org.jetbrains.kotlin.fir.expressions.FirExpression -import org.jetbrains.kotlin.fir.scopes.FirTypeScope import org.jetbrains.kotlin.fir.scopes.FirOverrideChecker +import org.jetbrains.kotlin.fir.scopes.FirTypeScope import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol abstract class AbstractFirOverrideScope( val session: FirSession, @@ -65,55 +60,4 @@ abstract class AbstractFirOverrideScope( return override } - protected open fun createFunctionCopy( - firSimpleFunction: FirSimpleFunction, - newSymbol: FirNamedFunctionSymbol - ): FirSimpleFunctionBuilder = - FirSimpleFunctionBuilder().apply { - source = firSimpleFunction.source - session = firSimpleFunction.session - resolvePhase = firSimpleFunction.resolvePhase - origin = FirDeclarationOrigin.SubstitutionOverride - returnTypeRef = firSimpleFunction.returnTypeRef - receiverTypeRef = firSimpleFunction.receiverTypeRef - name = firSimpleFunction.name - status = firSimpleFunction.status - symbol = newSymbol - } - - protected open fun createValueParameterCopy(parameter: FirValueParameter, newDefaultValue: FirExpression?): FirValueParameterBuilder = - FirValueParameterBuilder().apply { - source = parameter.source - session = parameter.session - resolvePhase = parameter.resolvePhase - origin = FirDeclarationOrigin.SubstitutionOverride - returnTypeRef = parameter.returnTypeRef - name = parameter.name - symbol = FirVariableSymbol(parameter.symbol.callableId) - defaultValue = newDefaultValue - isCrossinline = parameter.isCrossinline - isNoinline = parameter.isNoinline - isVararg = parameter.isVararg - } - - protected open fun createPropertyCopy( - firProperty: FirProperty, - newSymbol: FirPropertySymbol - ): FirPropertyBuilder = - FirPropertyBuilder().apply { - source = firProperty.source - session = firProperty.session - resolvePhase = firProperty.resolvePhase - origin = FirDeclarationOrigin.SubstitutionOverride - returnTypeRef = firProperty.returnTypeRef - receiverTypeRef = firProperty.receiverTypeRef - isVar = firProperty.isVar - isLocal = firProperty.isLocal - getter = firProperty.getter - setter = firProperty.setter - name = firProperty.name - status = firProperty.status - symbol = newSymbol - } - }