[WasmJs] Prohibit external classes to be a storage of an associated objects

Fix #KT-65355
This commit is contained in:
Igor Yakovlev
2024-01-27 02:23:04 +01:00
parent 6930fc8fed
commit 324d079111
13 changed files with 116 additions and 2 deletions
@@ -0,0 +1,21 @@
// FIR_IDENTICAL
@file:OptIn(ExperimentalAssociatedObjects::class)
import kotlin.reflect.AssociatedObjectKey
import kotlin.reflect.ExperimentalAssociatedObjects
import kotlin.reflect.KClass
import kotlin.reflect.findAssociatedObject
@AssociatedObjectKey
@Retention(AnnotationRetention.BINARY)
annotation class X(val kClass: KClass<*>)
object Promise
<!ASSOCIATED_OBJECT_INVALID_BINDING!>@X(Promise::class)<!>
external class Y
external class OuterExternal {
<!ASSOCIATED_OBJECT_INVALID_BINDING!>@X(Promise::class)<!>
class NestedExternal
}