final class Session { @NotNull private String name = "cwdoh"; @NotNull public final String getName() { return this.name; } public final void setName(@NotNull String var1) { Intrinsics.checkParameterIsNotNull(var1, "<set-?>"); this.name = var1; } }
public final class Session { @NotNull private String name = "cwdoh"; @NotNull public final String getName() { return this.name; } public final void setName(@NotNull String var1) { Intrinsics.checkParameterIsNotNull(var1, "<set-?>"); this.name = var1; } } public static void checkParameterIsNotNull(Object value, String paramName) { if (value == null) { throwParameterIsNullException(paramName); } }
name fun print() { val name: String = "cwdoh" print(hello(name)) } } /PU/VMMMPDBMWBSJBCMFQBSBNFUFS public final class Session { @NotNull public final String hello(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); return "hello, " + name; } public final void print() { String name = "cwdoh"; String var2 = this.hello(name); System.out.print(var2); } }
name fun print() { val name: String? = null print(hello(name!!)) } } .JYFE&YDFQUJPO public final class Session { @NotNull public final String hello(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); return "hello, " + name; } public final void print() { String name = (String)null; Intrinsics.throwNpe(); String var2 = this.hello(name); System.out.print(var2); } } NullPointerException?
= "Kotlin: How it works" var room: Int? = null fun description() = "$speaker's talk: '$title' at room $room" } 4USJOH5FNQMBUFDPODBUFOBUJPO public final class Session { @NotNull private final String speaker = "cwdoh"; @NotNull private final String title = "Kotlin: How it works"; @Nullable private Integer room; … @NotNull public final String description() { return "" + this.speaker + "'s talk: ‘" + this.title + "' at room " + this.room; } }
test() { val child = ChildClass() } 0QFOFEDMBTTJOUFSGBDF JOIFSJUBODF public final class ChildClass extends OpenClass implements Interface {} public interface Interface {} public class OpenClass {} public final class SimpleClassKt { public static final void test() { new ChildClass(); } }
class Person1 { public Person1(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); super(); } } public final class Person2 { public Person2(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); super(); } }
Boolean get() = this.size == 0 } $VTUPNHFUUFSTFUUFS public final class Props { private int size; public final int getSize() { return this.size; } public final void setSize(int var1) { this.size = var1; } public final boolean isEmpty() { return this.size == 0; } }
{ age = if (value < 0) 0 else value } } $BVUJPOTUBDLPWFSGMPX public final class Props { private int age; public final int getAge() { return this.age; } public final void setAge(int value) { this.setAge(value < 0? 0:value); } }
} TFUUFSHFUUFSNPEJGJFS public final class Props { private int age; public final int getAge() { return this.age; } private final void setAge(int var1) { this.age = var1; } }
fun blend(b: BlendMode) { when (b) { BlendMode.OPAQUE -> opaque() BlendMode.TRANSPARENT -> transparent() BlendMode.FADE -> fade() BlendMode.ADD -> add() } } public final class EnumTestKt$WhenMappings { // $FF: synthetic field public static final int[] $EnumSwitchMapping$0 = new int[BlendMode.values().length]; static { $EnumSwitchMapping$0[BlendMode.OPAQUE.ordinal()] = 1; $EnumSwitchMapping$0[BlendMode.TRANSPARENT.ordinal()] = 2; $EnumSwitchMapping$0[BlendMode.FADE.ordinal()] = 3; $EnumSwitchMapping$0[BlendMode.ADD.ordinal()] = 4; } } public final class EnumTestKt { public static final void blend(@NotNull BlendMode b) { Intrinsics.checkParameterIsNotNull(b, "b"); switch(EnumTestKt$WhenMappings.$EnumSwitchMapping$0[b.ordinal()]) { case 1: opaque(); break; case 2: transparent(); break; case 3: fade(); break; case 4: add(); } } }
b = 21u val c = a + b val d = a - b val e = a * b val f = a / b } int var1 = this.a; int var2 = this.b; int var4 = UInt.constructor-impl(var1 + var2); this.c = var4; var1 = this.a; var2 = this.b; var4 = UInt.constructor-impl(var1 - var2); this.d = var4; var1 = this.a; var2 = this.b; var4 = UInt.constructor-impl(var1 * var2); this.e = var4; var1 = this.a; var2 = this.b; var4 = UnsignedKt.uintDivide-J1ME1BU(var1, var2); this.f = var4;
println(i) } } public static final void testForLoopWithStep() { byte var3 = 0; IntProgression var10000 = RangesKt.step((IntProgression)(new IntRange(var3, 10)), 2); int i = var10000.getFirst(); int var1 = var10000.getLast(); int var2 = var10000.getStep(); if (var2 > 0) { if (i > var1) { return; } } else if (i < var1) { return; } while(true) { System.out.println(i); if (i == var1) { return; } i += var2; } }
fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) // Where am I????? // mWelcomeTextView = // findViewById(R.id.msgView) as TextView } } *GQSPQFSUZWBMVFJTJNNVUBCMFEVSJOH$MBTT-JGFDZDMF
by lazy { // following code will be executed at first access findViewById(R.id.message_view) as TextView } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } fun onSayHello() { messageView.text = "Hello" } } -B[ZJOJUJBMJ[BUJPO
by lazy { // I’ll be initialized lazily at first access findViewById(R.id.message_view) as TextView } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } fun onSayHello() { messageView.text = "Hello" } } #BDLUPDPEF
class B implements A { @NotNull public String hello() { return "Hello!!"; } } public final class C implements A { // $FF: synthetic field private final B $$delegate_0 = new B(); @NotNull public String hello() { return this.$$delegate_0.hello(); } } 4BNQMF$MBTTEFMFHBUJPO
fun D.foo() = "d" fun printFoo(c: C) { println(c.foo()) } class Demo { fun run() { printFoo(D()) } } 3VMF&YUFOTJPOTBSFSFTPMWFETUBUJDBMMZ public class C {} public final class D extends C {} public final class SimpleClassKt { @NotNull public static final String foo(@NotNull C $receiver) { Intrinsics.checkParameterIsNotNull($receiver, "$receiver"); return "c"; } @NotNull public static final String foo(@NotNull D $receiver) { Intrinsics.checkParameterIsNotNull($receiver, "$receiver"); return "d"; } public static final void printFoo(@NotNull C c) { Intrinsics.checkParameterIsNotNull(c, "c"); String var1 = foo(c); System.out.println(var1); } } public final class Demo { public final void run() { SimpleClassKt.printFoo((C)(new D())); } }
Person.hello() { println("উ֞?!!") } fun main(args: Array<String>) { Person().hello() } // Result hello! 3VMFNFNCFSBMXBZTCFBUTFYUFOTJPOJOTBNFTJHOBUVSF public final class Person { public final void hello() { String var1 = "hello!"; System.out.println(var1); } } public final class SimpleClassKt { public static final void hello(@NotNull Person $receiver) { Intrinsics.checkParameterIsNotNull( $receiver, "$receiver"); String var1 = "উ֞?!!"; System.out.println(var1); } public static final void main(@NotNull String[] args) { Intrinsics.checkParameterIsNotNull(args, "args"); (new Person()).hello(); } }
C { fun baz() { println("C.bar()") } fun D.foo() { bar() // calls D.bar baz() // calls C.baz } fun caller(d: D) { d.foo() } } 3VMF&YUFOTJPOJTEFDMBSFEJOTDPQF public final class C { public final void baz() { String var1 = "C.bar()"; System.out.println(var1); } public final void foo(@NotNull D $receiver) { Intrinsics.checkParameterIsNotNull($receiver, "$receiver"); $receiver.bar(); this.baz(); } public final void caller(@NotNull D d) { Intrinsics.checkParameterIsNotNull(d, "d"); this.foo(d); } } public final class D { public final void bar() { String var1 = "D.bar()"; System.out.println(var1); } }
return toString() } /VMMBCMFSFDFJWFS public final class SimpleClassKt { @NotNull public static final String toString(@Nullable Object $receiver) { return $receiver == null? "null":$receiver.toString(); } }
println("(Sing it!)") println("We will we will rock you") } fun beatbox() { println("pv zk bschk pv zk") } fun ensemble() { sing() beatbox() sing() beatbox() } public final class SimpleClassKt { public static final void sing() { String var0 = "We will we will rock you"; System.out.println(var0); var0 = "(Sing it!)"; System.out.println(var0); var0 = "We will we will rock you"; System.out.println(var0); } public static final void beatbox() { String var0 = "pv zk bschk pv zk"; System.out.println(var0); } public static final void ensemble() { sing(); beatbox(); sing(); beatbox(); } }
println("(Sing it!)") println("We will we will rock you") } fun beatbox() { println("pv zk bschk pv zk") } fun ensemble() { sing() beatbox() sing() beatbox() } public final class SimpleClassKt { public static final void sing() { String var1 = "We will we will rock you"; … } public static final void beatbox() { … } public static final void ensemble() { String var0 = "We will we will rock you"; System.out.println(var0); var0 = "(Sing it!)"; System.out.println(var0); var0 = "We will we will rock you"; System.out.println(var0); beatbox(); var0 = "We will we will rock you"; System.out.println(var0); var0 = "(Sing it!)"; System.out.println(var0); var0 = "We will we will rock you"; System.out.println(var0); beatbox(); } }
{ log { "Lorem ipsum dolor sit amet, consectetur ..." } } -PHHJOH public final class SimpleClassKt { public static final void log(@NotNull Function0 message) { Intrinsics.checkParameterIsNotNull(message, "message"); Object var1 = message.invoke(); System.out.println(var1); } public static final void test() { log((Function0)null.INSTANCE); } }
something!") trace("doSomething() is doing something!") } FNQUZJOMJOFGVODUJPO public final class SimpleClassKt { public static final void trace(@NotNull String message) { Intrinsics.checkParameterIsNotNull(message, "message"); } public static final void doSomething() { String var0 = "I'm doing something!"; System.out.print(var0); var0 = "doSomething() is doing something!"; } }
get() = (c shr 24) and 0xff val r get() = (c shr 16) and 0xff val g get() = (c shr 8) and 0xff val b get() = (c ) and 0xff } fun test() { val a = Color(0x7f_10_20_30) val b = Color(0x7f_30_20_10) println(a == b) println(a.equals(b)) } public final class InlineClassKt { public static final void test() { int a = Color.constructor-impl(2131763248); int b = Color.constructor-impl(2133860368); boolean var2 = Intrinsics.areEqual( Color.box-impl(a), Color.box-impl(b)); System.out.println(var2); var2 = Color.equals-impl(a, Color.box-impl(b)); System.out.println(var2); } }
onEvent(Widget widget); } private int listenerCount = 0; public int getListenerCount() { return listenerCount; } public void addListener(Listener listener) {} public void removeListener(Listener listener) {} } val w = Widget() val listener = { widget: Widget -> println("Listened to $widget") } w.addListener(listener) println(w.listenerCount) w.removeListener(listener) println(w.listenerCount)