Fix for KT-10881 Declaring constant in a mutlifile class causes an IllegalAccessError on its usage.
Generate fields for 'const' properties in facade class. NB reading annotations for 'const' vals in multifile class doesn't work, KT-10892.
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
import a.OK
|
||||
|
||||
fun box(): String {
|
||||
val okRef = ::OK
|
||||
|
||||
// TODO
|
||||
// val annotations = okRef.annotations
|
||||
// val numAnnotations = annotations.size
|
||||
// if (numAnnotations != 1) {
|
||||
// return "Failed, annotations: $annotations"
|
||||
// }
|
||||
|
||||
return okRef.get()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
@file:[JvmName("MultifileClass") JvmMultifileClass]
|
||||
package a
|
||||
|
||||
annotation class A
|
||||
|
||||
@A
|
||||
const val OK: String = "OK"
|
||||
Reference in New Issue
Block a user