Files
kotlin-fork/compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt
T
pyos 1cccf2645f FIR: serialize HAS_CONSTANT at least for const properties
Non-const properties may need them too with if the 1.4 feature
NoConstantValueAttributeForNonConstVals is disabled.
2020-11-30 13:05:28 +03:00

24 lines
469 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: A.kt
@file:[JvmName("MultifileClass") JvmMultifileClass]
package a
fun foo(): String = "OK"
const val constOK: String = "OK"
val valOK: String = "OK"
var varOK: String = "Hmmm?"
// FILE: B.kt
import a.*
fun box(): String {
if (foo() != "OK") return "Fail function"
if (constOK != "OK") return "Fail const"
if (valOK != "OK") return "Fail val"
varOK = "OK"
if (varOK != "OK") return "Fail var"
return varOK
}