diff --git a/compiler/fir/checkers/checkers.js/src/org/jetbrains/kotlin/fir/analysis/js/checkers/expression/FirJsReflectionAPICallChecker.kt b/compiler/fir/checkers/checkers.js/src/org/jetbrains/kotlin/fir/analysis/js/checkers/expression/FirJsReflectionAPICallChecker.kt index 61aa9d28a49..018c6c58bf3 100644 --- a/compiler/fir/checkers/checkers.js/src/org/jetbrains/kotlin/fir/analysis/js/checkers/expression/FirJsReflectionAPICallChecker.kt +++ b/compiler/fir/checkers/checkers.js/src/org/jetbrains/kotlin/fir/analysis/js/checkers/expression/FirJsReflectionAPICallChecker.kt @@ -23,7 +23,7 @@ object FirJsReflectionAPICallChecker : AbstractFirReflectionApiCallChecker() { override fun isAllowedReflectionApi(name: Name, containingClassId: ClassId, context: CheckerContext): Boolean { return super.isAllowedReflectionApi(name, containingClassId, context) || - containingClassId in StandardClassIds.associatedObjectAnnotations || + containingClassId in StandardClassIds.Annotations.associatedObjectAnnotations || name == StandardNames.FqNames.findAssociatedObject.shortName() } diff --git a/core/compiler.common/src/org/jetbrains/kotlin/name/StandardClassIds.kt b/core/compiler.common/src/org/jetbrains/kotlin/name/StandardClassIds.kt index 0c0b9e4605b..eac2407f463 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/name/StandardClassIds.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/name/StandardClassIds.kt @@ -93,8 +93,6 @@ object StandardClassIds { val constantAllowedTypes = primitiveTypes + unsignedTypes + String - val associatedObjectAnnotations = hashSetOf(Annotations.AssociatedObjectKey, Annotations.ExperimentalAssociatedObjects) - val Continuation = "Continuation".coroutinesId() @Suppress("FunctionName") @@ -196,6 +194,8 @@ object StandardClassIds { val AssociatedObjectKey = "AssociatedObjectKey".reflectId() val ExperimentalAssociatedObjects = "ExperimentalAssociatedObjects".reflectId() + val associatedObjectAnnotations = hashSetOf(AssociatedObjectKey, ExperimentalAssociatedObjects) + object ParameterNames { val value = Name.identifier("value") diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/JsReflectionAPICallChecker.kt b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/JsReflectionAPICallChecker.kt index 4b80d603702..262321b7b6c 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/JsReflectionAPICallChecker.kt +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/JsReflectionAPICallChecker.kt @@ -41,7 +41,7 @@ class JsReflectionAPICallChecker( context: CallCheckerContext ): Boolean { return super.isAllowedReflectionApi(descriptor, containingClass, context) || - containingClass.classId in StandardClassIds.associatedObjectAnnotations || + containingClass.classId in StandardClassIds.Annotations.associatedObjectAnnotations || descriptor.name == StandardNames.FqNames.findAssociatedObject.shortName() }