Skip to content

Commit

Permalink
Create FIR fake source element for checked safe call subject
Browse files Browse the repository at this point in the history
  • Loading branch information
mglukhikh committed Nov 26, 2020
1 parent 2592eed commit 558ac16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ fun FirQualifiedAccess.wrapWithSafeCall(receiver: FirExpression): FirSafeCallExp
this.originalReceiverRef = FirExpressionRef<FirExpression>().apply {
bind(receiver)
}
this.source = receiver.source
this.source = receiver.source?.fakeElement(FirFakeSourceElementKind.CheckedSafeCallSubject)
}

replaceExplicitReceiver(checkedSafeCallSubject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ sealed class FirFakeSourceElementKind : FirSourceElementKind() {
// fun foo(vararg args: Int) {}
// fun bar(1, 2, 3) --> [resolved] fun bar(VarargArgument(1, 2, 3))
object VarargArgument : FirFakeSourceElementKind()

// Part of desugared x?.y
object CheckedSafeCallSubject : FirFakeSourceElementKind()
}

sealed class FirSourceElement {
Expand Down

0 comments on commit 558ac16

Please sign in to comment.