Why? javap get wrong signature of kotlin inner class's constructor


#1

//inner.kt
class OuterClass {
inner class InnerClass() {
}
}

kotlinc inner.kt
javap OuterClass$InnerClass.class

Compiled from "inner.kt"
public final class OuterClass$InnerClass {
final OuterClass this$0;
public OuterClass$InnerClass();
}

javap -v OuterClass$InnerClass.class



public OuterClass$InnerClass();
descriptor: (LOuterClass;)V
flags: ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
0: aload_0
1: aload_1
2: putfield #10 // Field this$0:LOuterClass;
5: aload_0
6: invokespecial #13 // Method java/lang/Object."":()V
9: return
LocalVariableTable:
Start Length Slot Name Signature
0 10 0 this LOuterClass$InnerClass;
0 10 1 $outer LOuterClass;
LineNumberTable:
line 2: 0
Signature: #11 // ()V

right signature is "(LOuterClass;)V"
javap get currect signature of java inner class’s constructor

//Outer.java
public class OuterClass {
public class InnerClass {
}
}

javac OuterClass.java
javap OuterClass$InnerClass.class

Compiled from "OuterClass.java"
public class OuterClass$InnerClass {
final OuterClass this$0;
public OuterClass$InnerClass(OuterClass);
}

javap -v OuterClass$InnerClass.class



public OuterClass$InnerClass(OuterClass);
descriptor: (LOuterClass;)V