[FE, IR] Store PsiElement for mismatched annotation's actual target

There is IDE quick fix which suggests to copy mismatched annotation
from `expect` to `actual` (see KTIJ-26633). It needs to find
`actual` PsiElement where to add annotation. Before previous commit, it
was easy - just get source of `Incompatibility.actualSymbol`.
After previous commit, the problem might be in value parameter, while
`actualSymbol` would contain function symbol. This is solved by adding
new field `Incompatibility.actualAnnotationTargetElement`.

`SourceElementMarker` introduced, because it's needed to be used in
abstract checker. Existing `DeclarationSymbolMarker` doesn't fit
because in next PR for this issue annotations set on types will be reported,
and types are not declarations.

^KT-60671
This commit is contained in:
Roman Efremov
2023-09-07 16:50:34 +02:00
committed by Space Team
parent 5c95f69aef
commit 420dceb7d8
20 changed files with 108 additions and 22 deletions
@@ -0,0 +1,14 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.mpp
/**
* Common interface, which stores a link to a source element of declaration or type reference (or null, if no source).
* The idea is similar to [DeclarationSymbolMarker], but it doesn't fit, because
* sources of type references also must be supported, which are not declarations.
* Used in [org.jetbrains.kotlin.resolve.calls.mpp.AbstractExpectActualAnnotationMatchChecker].
*/
interface SourceElementMarker