FIR: Fix fir2symbol inconsistencies for imported properties

Do not copy delegateFieldSymbol because otherwise the old symbol will be rebound
to the new instance of a property
This commit is contained in:
Denis Zharkov
2020-10-23 17:09:29 +03:00
parent 09b7237ae5
commit b6a312483a
@@ -5,7 +5,7 @@
package org.jetbrains.kotlin.fir.scopes.impl
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.declarations.builder.buildPropertyCopy
import org.jetbrains.kotlin.fir.declarations.builder.buildSimpleFunctionCopy
import org.jetbrains.kotlin.fir.scopes.FirContainingNamesAwareScope
@@ -47,6 +47,7 @@ class FirObjectImportedCallableScope(
val syntheticFunction = buildPropertyCopy(property) {
origin = FirDeclarationOrigin.ImportedFromObject
this.symbol = FirPropertySymbol(CallableId(importedClassId, name), overriddenSymbol = symbol)
this.delegateFieldSymbol = null
}.apply {
importedFromObjectClassId = importedClassId
}