K2: don't report inline access errors on const properties in annotations

#KT-60604 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-11-14 10:09:44 +01:00
committed by Space Team
parent bb8002d9f1
commit 5cd3f8bb97
3 changed files with 5 additions and 9 deletions
@@ -229,9 +229,10 @@ object FirInlineDeclarationChecker : FirFunctionChecker() {
context: CheckerContext,
reporter: DiagnosticReporter,
) {
if (
calledDeclaration == null ||
calledDeclaration.callableId.callableName == BACKING_FIELD
if (calledDeclaration == null ||
calledDeclaration.callableId.callableName == BACKING_FIELD ||
calledDeclaration is FirPropertySymbol && calledDeclaration.isConst &&
context.callsOrAssignments.any { it is FirAnnotationCall }
) {
return
}
@@ -1,6 +0,0 @@
// ISSUE: KT-60604
private const val MESSAGE = "This is deprecated"
@Deprecated(<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>MESSAGE<!>)
inline fun hello(f: () -> Int): Int = f()
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-60604
private const val MESSAGE = "This is deprecated"