[FIR] preserve real source for property accessors
^ KT-59705 If property is delegated, it can't have property accessors with non-default impl, but it can contain property accessors declarations with non-default visibility, annotations, etc. Seems, it's more logical to preserve them as fake sources than use property itself
This commit is contained in:
+4
-2
@@ -417,8 +417,9 @@ fun <T> FirPropertyBuilder.generateAccessorsByDelegate(
|
||||
val annotations = getter?.annotations
|
||||
val returnTarget = FirFunctionTarget(null, isLambda = false)
|
||||
val getterStatus = getter?.status
|
||||
val getterElement = getter?.source?.fakeElement(KtFakeSourceElementKind.DelegatedPropertyAccessor) ?: fakeSource
|
||||
getter = buildPropertyAccessor {
|
||||
this.source = fakeSource
|
||||
this.source = getterElement
|
||||
this.moduleData = moduleData
|
||||
origin = FirDeclarationOrigin.Source
|
||||
returnTypeRef = FirImplicitTypeRefImplWithoutSource
|
||||
@@ -456,8 +457,9 @@ fun <T> FirPropertyBuilder.generateAccessorsByDelegate(
|
||||
val annotations = setter?.annotations
|
||||
val parameterAnnotations = setter?.valueParameters?.firstOrNull()?.annotations
|
||||
val setterStatus = setter?.status
|
||||
val setterElement = setter?.source?.fakeElement(KtFakeSourceElementKind.DelegatedPropertyAccessor) ?: fakeSource
|
||||
setter = buildPropertyAccessor {
|
||||
this.source = fakeSource
|
||||
this.source = setterElement
|
||||
this.moduleData = moduleData
|
||||
origin = FirDeclarationOrigin.Source
|
||||
returnTypeRef = moduleData.session.builtinTypes.unitType
|
||||
|
||||
Reference in New Issue
Block a user