[FE] Allow @OptionalExpectation to be present only on expect
^KT-58551
This commit is contained in:
committed by
Space Team
parent
1a4ab9bb4b
commit
b6cae1adcc
+4
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.resolve.calls.mpp
|
||||
|
||||
import org.jetbrains.kotlin.mpp.DeclarationSymbolMarker
|
||||
import org.jetbrains.kotlin.mpp.TypeAliasSymbolMarker
|
||||
import org.jetbrains.kotlin.name.StandardClassIds
|
||||
|
||||
object AbstractExpectActualAnnotationMatchChecker {
|
||||
class Incompatibility(val expectSymbol: DeclarationSymbolMarker, val actualSymbol: DeclarationSymbolMarker)
|
||||
@@ -30,6 +31,9 @@ object AbstractExpectActualAnnotationMatchChecker {
|
||||
val actualAnnotationsByName = actualSymbol.annotations.groupBy { it.classId }
|
||||
|
||||
for (expectAnnotation in expectSymbol.annotations) {
|
||||
if (expectAnnotation.classId == StandardClassIds.Annotations.OptionalExpectation) {
|
||||
continue
|
||||
}
|
||||
val actualAnnotationsWithSameClassId = actualAnnotationsByName[expectAnnotation.classId] ?: emptyList()
|
||||
if (actualAnnotationsWithSameClassId.none { areAnnotationArgumentsEqual(expectAnnotation, it) }) {
|
||||
return Incompatibility(expectSymbol, actualSymbol)
|
||||
|
||||
Reference in New Issue
Block a user