~/JVMAnnotationSample/app/src/main/java/com/example/jvmannotationsample/jvm_name/GenericList.kt: (3, 1): Platform declaration clash: The following declarations have the same JVM signature (filterValid(Ljava/util/List;)Ljava/util/List;):
fun List<Int>.filterValid(): List<Int> defined in com.example.jvmannotationsample.jvm_name in file GenericList.kt
fun List<String>.filterValid(): List<String> defined in com.example.jvmannotationsample.jvm_name in file GenericList.kt
javap -c ./app/build/tmp/kotlin-classes/debug/com/example/jvmannotationsample/jvm_name/OnPropertiesSampleKt.class
Compiled from "OnPropertiesSample.kt"public final class com.example.jvmannotationsample.jvm_name.OnPropertiesSampleKt { public static final int x();
Code:
0: getstatic #11 // Field x:I 3: ireturn
public static final void changeX(int);
Code:
0: iload_0
1: putstatic #11 // Field x:I 4: returnstatic {};
Code:
0: bipush 23
2: putstatic #11 // Field x:I 5: return}
Kotlin调用处的代码
12345678910111213
javap -c ./app/build/tmp/kotlin-classes/debug/com/example/jvmannotationsample/jvm_name/KotlinPlaygroundKt.class
Compiled from "KotlinPlayground.kt"public final class com.example.jvmannotationsample.jvm_name.KotlinPlaygroundKt { public static final void testJvmNameOnProperty();
Code:
0: sipush 1111
3: invokestatic #36 // Method com/example/jvmannotationsample/jvm_name/OnPropertiesSampleKt.changeX:(I)V 6: invokestatic #40 // Method com/example/jvmannotationsample/jvm_name/OnPropertiesSampleKt.x:()I 9: pop
10: return}