[FIR] Set source on return expression in generated getters
#KT-55835
This commit is contained in:
committed by
Space Team
parent
ef086a4c88
commit
311975f1ed
+3
-1
@@ -24,7 +24,9 @@ import org.jetbrains.kotlin.fir.types.*
|
|||||||
|
|
||||||
object FirFunctionReturnTypeMismatchChecker : FirReturnExpressionChecker() {
|
object FirFunctionReturnTypeMismatchChecker : FirReturnExpressionChecker() {
|
||||||
override fun check(expression: FirReturnExpression, context: CheckerContext, reporter: DiagnosticReporter) {
|
override fun check(expression: FirReturnExpression, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||||
if (expression.source == null) return
|
// checked in FirDelegatedPropertyChecker
|
||||||
|
if (expression.source?.kind == KtFakeSourceElementKind.DelegatedPropertyAccessor) return
|
||||||
|
|
||||||
val targetElement = expression.target.labeledElement
|
val targetElement = expression.target.labeledElement
|
||||||
if (targetElement is FirErrorFunction || targetElement is FirAnonymousFunction && targetElement.isLambda) {
|
if (targetElement is FirErrorFunction || targetElement is FirAnonymousFunction && targetElement.isLambda) {
|
||||||
return
|
return
|
||||||
|
|||||||
+1
@@ -448,6 +448,7 @@ fun <T> FirPropertyBuilder.generateAccessorsByDelegate(
|
|||||||
origin = FirFunctionCallOrigin.Operator
|
origin = FirFunctionCallOrigin.Operator
|
||||||
}
|
}
|
||||||
target = returnTarget
|
target = returnTarget
|
||||||
|
source = fakeSource
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (annotations != null) {
|
if (annotations != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user