Properly calculate isConst for java properties

This commit is contained in:
Michael Bogdanov
2016-02-17 13:58:23 +03:00
parent c5d788d049
commit af3437626b
4 changed files with 20 additions and 5 deletions

View File

@@ -12,6 +12,9 @@ public class JClass {
public final static char PrimitiveChar = 'K';
public final static String Str = ":J";
@Nullable
public final static String StrNullable = "nullable";
@NotNull
public final static Integer BoxedInt = 9500;

View File

@@ -1,6 +1,9 @@
object KoKobject {
@JvmStatic
@JvmField
val JvmStatic: Int = 1
@JvmField
val JvmStaticString: String? = "123"
}
fun test() {
@@ -20,10 +23,12 @@ fun test() {
JClass.BoxedInt
JClass.NonFinal
JClass.StrNullable
JClass().NonStatic
KoKobject.JvmStatic
KoKobject.JvmStaticString
}
// @TestKt.class:
@@ -42,6 +47,8 @@ fun test() {
// 1 GETSTATIC JClass.BoxedInt : Ljava/lang/Integer;
// 1 GETSTATIC JClass.NonFinal : I
// 1 GETFIELD JClass.NonStatic : I
// 1 INVOKESTATIC KoKobject.getJvmStatic \(\)I
// 1 LDC "nullable"
// 1 GETSTATIC KoKobject.JvmStatic : I
// 1 GETSTATIC KoKobject.JvmStaticString : Ljava/lang/String
// 3 POP2
// 16 POP
// 18 POP