Files
kotlin-fork/compiler/testData/codegen/box/multifileClasses/optimized/callableReferencesToSamePropertiesFromDifferentPackages.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

38 lines
662 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// TODO: KT-37972 IllegalAccessError on initializing property reference for a property declared in JvmMultifileClass with -Xmultifile-parts-inherit
// IGNORE_BACKEND: JVM
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: box.kt
import a.propRefA
import b.propRefB
fun box(): String {
if (propRefA != propRefB) return "Fail: propRefA != propRefB"
return "OK"
}
// FILE: a.kt
package a
import test.property
val propRefA = ::property
// FILE: b.kt
package b
import test.property
val propRefB = ::property
// FILE: part.kt
@file:[JvmName("MultifileClass") JvmMultifileClass]
package test
val property: String get() = ""