Add UL support for const fields initializers

Fixed #KT-34081
This commit is contained in:
Igor Yakovlev
2019-11-22 21:34:44 +03:00
parent 775eb67219
commit 0ff77bd3c5
6 changed files with 82 additions and 37 deletions
+22
View File
@@ -29,3 +29,25 @@ object Obj : java.lang.Runnable {
override fun run() {}
@JvmStatic fun zoo(): Int = 2
}
object ConstContainer {
const val str = "one" // String
const val one = 1 // Int
const val oneLong = 1L // Long
const val complexLong = 1L + 1 // Long
const val e = 2.7182818284 // Double
const val eFloat = 2.7182818284f // Float
const val complexFloat = 2.7182818284f + 2.4 // Float
}
class ClassWithConstContainer {
companion object {
const val str = "one" // String
const val one = 1 // Int
const val oneLong = 1L // Long
const val complexLong = 1L + 1 // Long
const val e = 2.7182818284 // Double
const val eFloat = 2.7182818284f // Float
const val complexFloat = 2.7182818284f + 2.4 // Float
}
}