I did a compile to bytecode and decompile to java,...
# announcements
b
I did a compile to bytecode and decompile to java, and this appears to be the case:
Copy code
public static final void main(@NotNull String[] args) {
  Intrinsics.checkParameterIsNotNull(args, "args");
  MyType bar$iv = new MyType();
  doSomething(bar$iv);
}
🆒 1
t
yes it does seem so. I just decompiled the bytecode with optimizations too
Copy code
public final static main2([Ljava/lang/String;)V
    @Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0
   L0
    ALOAD 0
    LDC "args"
    INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull (Ljava/lang/Object;Ljava/lang/String;)V
   L1
    LINENUMBER 135 L1
    NEW com/tschuchort/kotlinelements/MyType
    DUP
    INVOKESPECIAL com/tschuchort/kotlinelements/MyType.<init> ()V
    ASTORE 1
   L2
    LINENUMBER 137 L2
   L3
    LINENUMBER 138 L3
    ALOAD 1
    INVOKESTATIC com/tschuchort/kotlinelements/MainKt.doSomething (Lcom/tschuchort/kotlinelements/MyType;)V
   L4
    LINENUMBER 141 L4
   L5
    NOP
   L6
    LINENUMBER 136 L6
    RETURN
   L7
    LOCALVARIABLE bar$iv Lcom/tschuchort/kotlinelements/MyType; L2 L6 1
    LOCALVARIABLE $i$f$foo I L2 L6 2
    LOCALVARIABLE args [Ljava/lang/String; L0 L7 0
    MAXSTACK = 2
    MAXLOCALS = 3
the call is directly to
doSomething