[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() {
|
||||
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
|
||||
|
||||
+2
-1
@@ -448,6 +448,7 @@ fun <T> FirPropertyBuilder.generateAccessorsByDelegate(
|
||||
origin = FirFunctionCallOrigin.Operator
|
||||
}
|
||||
target = returnTarget
|
||||
source = fakeSource
|
||||
}
|
||||
)
|
||||
if (annotations != null) {
|
||||
@@ -671,4 +672,4 @@ fun buildBalancedOrExpressionTree(conditions: List<FirExpression>, lower: Int =
|
||||
fun AnnotationUseSiteTarget?.appliesToPrimaryConstructorParameter() = this == null ||
|
||||
this == AnnotationUseSiteTarget.CONSTRUCTOR_PARAMETER ||
|
||||
this == AnnotationUseSiteTarget.RECEIVER ||
|
||||
this == AnnotationUseSiteTarget.FILE
|
||||
this == AnnotationUseSiteTarget.FILE
|
||||
|
||||
Reference in New Issue
Block a user