mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
Add UL support for const fields initializers
Fixed #KT-34081
This commit is contained in:
@@ -45,7 +45,7 @@ final class null /* null*/ {
|
||||
@null()
|
||||
public static final java.lang.Object INSTANCE;
|
||||
|
||||
private static final java.lang.String fy /* constant value text */;
|
||||
private static final java.lang.String fy = "text" /* initializer type: java.lang.String */ /* constant value text */;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getFy();
|
||||
@@ -104,7 +104,7 @@ final class null /* null*/ {
|
||||
@null()
|
||||
public static final java.lang.Object INSTANCE;
|
||||
|
||||
private static final java.lang.String fy /* constant value text */;
|
||||
private static final java.lang.String fy = "text" /* initializer type: java.lang.String */ /* constant value text */;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getFy();
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user