[FIR] Properly setup source element for FirSafeCallExpression
This commit is contained in:
committed by
teamcityserver
parent
26b9948e5f
commit
f18e38a49f
+3
-1
@@ -494,9 +494,11 @@ class ExpressionsConverter(
|
||||
|
||||
(firSelector as? FirQualifiedAccess)?.let {
|
||||
if (isSafe) {
|
||||
@OptIn(FirImplementationDetail::class)
|
||||
it.replaceSource(dotQualifiedExpression.toFirSourceElement(FirFakeSourceElementKind.DesugaredSafeCallExpression))
|
||||
return it.wrapWithSafeCall(
|
||||
firReceiver!!,
|
||||
dotQualifiedExpression.toFirSourceElement(FirFakeSourceElementKind.DesugaredSafeCallExpression)
|
||||
dotQualifiedExpression.toFirSourceElement()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -2085,9 +2085,11 @@ open class RawFirBuilder(
|
||||
val receiver = expression.receiverExpression.toFirExpression("Incorrect receiver expression")
|
||||
|
||||
if (expression is KtSafeQualifiedExpression) {
|
||||
@OptIn(FirImplementationDetail::class)
|
||||
firSelector.replaceSource(expression.toFirSourceElement(FirFakeSourceElementKind.DesugaredSafeCallExpression))
|
||||
return firSelector.wrapWithSafeCall(
|
||||
receiver,
|
||||
expression.toFirSourceElement(FirFakeSourceElementKind.DesugaredSafeCallExpression)
|
||||
expression.toFirSourceElement()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user