K2: don't report inline access errors on const properties in annotations
#KT-60604 Fixed
This commit is contained in:
committed by
Space Team
parent
bb8002d9f1
commit
5cd3f8bb97
+4
-3
@@ -229,9 +229,10 @@ object FirInlineDeclarationChecker : FirFunctionChecker() {
|
|||||||
context: CheckerContext,
|
context: CheckerContext,
|
||||||
reporter: DiagnosticReporter,
|
reporter: DiagnosticReporter,
|
||||||
) {
|
) {
|
||||||
if (
|
if (calledDeclaration == null ||
|
||||||
calledDeclaration == null ||
|
calledDeclaration.callableId.callableName == BACKING_FIELD ||
|
||||||
calledDeclaration.callableId.callableName == BACKING_FIELD
|
calledDeclaration is FirPropertySymbol && calledDeclaration.isConst &&
|
||||||
|
context.callsOrAssignments.any { it is FirAnnotationCall }
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -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
|
// ISSUE: KT-60604
|
||||||
|
|
||||||
private const val MESSAGE = "This is deprecated"
|
private const val MESSAGE = "This is deprecated"
|
||||||
|
|||||||
Reference in New Issue
Block a user