From b6a312483a46cd128963f1d0fd1547020f6ba914 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Fri, 23 Oct 2020 17:09:29 +0300 Subject: [PATCH] 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 --- .../kotlin/fir/scopes/impl/FirObjectImportedCallableScope.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirObjectImportedCallableScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirObjectImportedCallableScope.kt index d5b0ecbc081..8842b30403e 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirObjectImportedCallableScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirObjectImportedCallableScope.kt @@ -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 }