Files
kotlin-fork/compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationTrait.kt
T
Alexander Udalov 00de5dae32 JVM IR: copy property instead of field in MoveOrCopyCompanionObjectFieldsLowering
This way we're making sure that the copied field has some associated
property, where we can get the value of isConst flag from. That flag is
later used in StaticInitializersLowering to determine whether we need to
erase initializer of a field. The tests are unmuted because now the
initializer is correctly _not_ erased. (They were passing before
switching master to 1.4 because without
NoConstantValueAttributeForNonConstVals, we treated all static fields
with primitive/string values as const, and never erased initializers
because of that.)
2020-02-04 11:43:24 +01:00

24 lines
623 B
Kotlin
Vendored

package test
annotation class AString(val value: String)
annotation class AChar(val value: Char)
annotation class AInt(val value: Int)
annotation class AByte(val value: Byte)
annotation class ALong(val value: Long)
annotation class ADouble(val value: Double)
annotation class AFloat(val value: Float)
interface Test {
companion object {
const val vstring: String = "Test"
const val vchar: Char = 'c'
const val vint: Int = 10
const val vbyte: Byte = 11
const val vlong: Long = 12
const val vdouble: Double = 1.2
const val vfloat: Float = 1.3.toFloat()
}
}