Skip to content

Instantly share code, notes, and snippets.

@dmitriigriazin
Created November 15, 2019 12:56
Show Gist options
  • Save dmitriigriazin/29421d190baea9b8f9059aa6b18a5877 to your computer and use it in GitHub Desktop.
Save dmitriigriazin/29421d190baea9b8f9059aa6b18a5877 to your computer and use it in GitHub Desktop.
Kotlin initialization
open class Constants(val a: Unit = print("a")) {
val x: Unit = print("x")
val int by lazy {
print("int")
1
}
init {
var z: Unit = print("z")
}
val b = print("b")
companion object {
var FOO: Unit = print("FOO")
}
val y: Unit = print("y")
}
@dmitriigriazin
Copy link
Author


public class Constants {
   // $FF: synthetic field
   static final KProperty[] $$delegatedProperties = new KProperty[]{(KProperty)Reflection.property1(new PropertyReference1Impl(Reflection.getOrCreateKotlinClass(Constants.class), "int", "getInt()I"))};
   @NotNull
   private final Unit x;
   @NotNull
   private final Lazy int$delegate;
   @NotNull
   private final Unit b;
   @NotNull
   private final Unit y;
   @NotNull
   private final Unit a;
   @NotNull
   private static Unit FOO;
   public static final Constants.Companion Companion = new Constants.Companion((DefaultConstructorMarker)null);

   static {
      String var0 = "FOO";
      boolean var1 = false;
      System.out.print(var0);
      FOO = Unit.INSTANCE;
   }

   @NotNull
   public final Unit getX() {
      return this.x;
   }

   public final int getInt() {
      Lazy var1 = this.int$delegate;
      KProperty var3 = $$delegatedProperties[0];
      boolean var4 = false;
      return ((Number)var1.getValue()).intValue();
   }

   @NotNull
   public final Unit getB() {
      return this.b;
   }

   @NotNull
   public final Unit getY() {
      return this.y;
   }

   @NotNull
   public final Unit getA() {
      return this.a;
   }

   public Constants(@NotNull Unit a) {
      Intrinsics.checkParameterIsNotNull(a, "a");
      super();
      this.a = a;
      String var2 = "x";
      boolean var3 = false;
      System.out.print(var2);
      this.x = Unit.INSTANCE;
      this.int$delegate = LazyKt.lazy((Function0)null.INSTANCE);
      String var7 = "z";
      boolean var4 = false;
      System.out.print(var7);
      Unit var6 = Unit.INSTANCE;
      var2 = "b";
      var3 = false;
      System.out.print(var2);
      this.b = Unit.INSTANCE;
      var2 = "y";
      var3 = false;
      System.out.print(var2);
      this.y = Unit.INSTANCE;
   }

   // $FF: synthetic method
   public Constants(Unit var1, int var2, DefaultConstructorMarker var3) {
      if ((var2 & 1) != 0) {
         String var4 = "a";
         boolean var5 = false;
         System.out.print(var4);
         var1 = Unit.INSTANCE;
      }

      this(var1);
   }

   public Constants() {
      this((Unit)null, 1, (DefaultConstructorMarker)null);
   }

   @Metadata(
      mv = {1, 1, 15},
      bv = {1, 0, 3},
      k = 1,
      d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0006\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u001c\u0010\u0003\u001a\u00020\u0004X\u0086\u000e¢\u0006\u0010\n\u0002\u0010\t\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\b¨\u0006\n"},
      d2 = {"Lcom/interview/abcstack/Constants$Companion;", "", "()V", "FOO", "", "getFOO", "()Lkotlin/Unit;", "setFOO", "(Lkotlin/Unit;)V", "Lkotlin/Unit;", "app"}
   )
   public static final class Companion {
      @NotNull
      public final Unit getFOO() {
         return Constants.FOO;
      }

      public final void setFOO(@NotNull Unit var1) {
         Intrinsics.checkParameterIsNotNull(var1, "<set-?>");
         Constants.FOO = var1;
      }

      private Companion() {
      }

      // $FF: synthetic method
      public Companion(DefaultConstructorMarker $constructor_marker) {
         this();
      }
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment