FIR: Use copy-builders at FirObjectImportedCallableScope
This commit is contained in:
+5
-26
@@ -6,8 +6,8 @@
|
|||||||
package org.jetbrains.kotlin.fir.scopes.impl
|
package org.jetbrains.kotlin.fir.scopes.impl
|
||||||
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
||||||
import org.jetbrains.kotlin.fir.declarations.builder.buildProperty
|
import org.jetbrains.kotlin.fir.declarations.builder.buildPropertyCopy
|
||||||
import org.jetbrains.kotlin.fir.declarations.builder.buildSimpleFunction
|
import org.jetbrains.kotlin.fir.declarations.builder.buildSimpleFunctionCopy
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirContainingNamesAwareScope
|
import org.jetbrains.kotlin.fir.scopes.FirContainingNamesAwareScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirTypeScope
|
import org.jetbrains.kotlin.fir.scopes.FirTypeScope
|
||||||
@@ -30,19 +30,9 @@ class FirObjectImportedCallableScope(
|
|||||||
return@wrapper
|
return@wrapper
|
||||||
}
|
}
|
||||||
val function = symbol.fir
|
val function = symbol.fir
|
||||||
val syntheticFunction = buildSimpleFunction {
|
val syntheticFunction = buildSimpleFunctionCopy(function) {
|
||||||
source = function.source
|
|
||||||
session = function.session
|
|
||||||
origin = FirDeclarationOrigin.ImportedFromObject
|
origin = FirDeclarationOrigin.ImportedFromObject
|
||||||
returnTypeRef = function.returnTypeRef
|
|
||||||
receiverTypeRef = function.receiverTypeRef
|
|
||||||
this.name = function.name
|
|
||||||
status = function.status
|
|
||||||
this.symbol = FirNamedFunctionSymbol(CallableId(importedClassId, name), overriddenSymbol = symbol)
|
this.symbol = FirNamedFunctionSymbol(CallableId(importedClassId, name), overriddenSymbol = symbol)
|
||||||
resolvePhase = function.resolvePhase
|
|
||||||
typeParameters.addAll(function.typeParameters)
|
|
||||||
valueParameters.addAll(function.valueParameters)
|
|
||||||
annotations.addAll(function.annotations)
|
|
||||||
}
|
}
|
||||||
processor(syntheticFunction.symbol)
|
processor(syntheticFunction.symbol)
|
||||||
}
|
}
|
||||||
@@ -55,20 +45,9 @@ class FirObjectImportedCallableScope(
|
|||||||
return@wrapper
|
return@wrapper
|
||||||
}
|
}
|
||||||
val property = symbol.fir
|
val property = symbol.fir
|
||||||
val syntheticFunction = buildProperty {
|
val syntheticFunction = buildPropertyCopy(property) {
|
||||||
source = property.source
|
|
||||||
session = property.session
|
|
||||||
origin = FirDeclarationOrigin.ImportedFromObject
|
origin = FirDeclarationOrigin.ImportedFromObject
|
||||||
returnTypeRef = property.returnTypeRef
|
|
||||||
receiverTypeRef = property.receiverTypeRef
|
|
||||||
this.name = property.name
|
|
||||||
status = property.status
|
|
||||||
isVar = property.isVar
|
|
||||||
isLocal = property.isLocal
|
|
||||||
this.symbol = FirPropertySymbol(CallableId(importedClassId, name), overriddenSymbol = symbol)
|
this.symbol = FirPropertySymbol(CallableId(importedClassId, name), overriddenSymbol = symbol)
|
||||||
resolvePhase = property.resolvePhase
|
|
||||||
typeParameters.addAll(property.typeParameters)
|
|
||||||
annotations.addAll(property.annotations)
|
|
||||||
}
|
}
|
||||||
processor(syntheticFunction.symbol)
|
processor(syntheticFunction.symbol)
|
||||||
}
|
}
|
||||||
@@ -77,4 +56,4 @@ class FirObjectImportedCallableScope(
|
|||||||
override fun getCallableNames(): Set<Name> = objectUseSiteScope.getCallableNames()
|
override fun getCallableNames(): Set<Name> = objectUseSiteScope.getCallableNames()
|
||||||
|
|
||||||
override fun getClassifierNames(): Set<Name> = emptySet()
|
override fun getClassifierNames(): Set<Name> = emptySet()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user