[FIR] Set source on return expression in generated getters

#KT-55835
This commit is contained in:
Kirill Rakhman
2023-06-26 14:42:17 +03:00
committed by Space Team
parent ef086a4c88
commit 311975f1ed
2 changed files with 5 additions and 2 deletions
@@ -24,7 +24,9 @@ import org.jetbrains.kotlin.fir.types.*
object FirFunctionReturnTypeMismatchChecker : FirReturnExpressionChecker() {
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
if (targetElement is FirErrorFunction || targetElement is FirAnonymousFunction && targetElement.isLambda) {
return