-
-
Save kmizu/3438c6882448a12227371dabe89baf57 to your computer and use it in GitHub Desktop.
M.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ kotlinc M.kt | |
$ javap -c MKt | |
Compiled from "M.kt" | |
public final class MKt { | |
public static final void main(java.lang.String[]); | |
Code: | |
0: aload_0 | |
1: ldc #9 // String args | |
3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull:(Ljava/lang/Object;Ljava/lang/String;)V | |
6: aconst_null | |
7: checkcast #17 // class java/lang/String | |
10: astore_1 | |
11: aload_1 | |
12: dup | |
13: ifnull 25 | |
16: invokevirtual #21 // Method java/lang/String.length:()I | |
19: invokestatic #27 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer; | |
22: goto 27 | |
25: pop | |
26: aconst_null | |
27: astore_2 | |
28: getstatic #33 // Field java/lang/System.out:Ljava/io/PrintStream; | |
31: aload_2 | |
32: invokevirtual #39 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V | |
35: return | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
val message: String? = null | |
println(message?.length) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment