The class streams4/ZKt$b3$1 is generated as follows final class streams4.ZKt$b3$1 extends .internal. Instead of having the method in-place, it now generates an inner class for the state-machine to implement the suspend. public static final b3() ĭescriptor: (Lkotlin/coroutines/experimental/Continuation )Ljava/lang/Object ģ: invokestatic #19 // Method kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull:(Ljava/lang/Object Ljava/lang/String )Vġ1: invokespecial #38 // Method streams4/ZKt$b3$1."":(Lkotlin/coroutines/experimental/Continuation )Vġ4: getstatic #25 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit ġ8: invokevirtual #42 // Method streams4/ZKt$b3$1.doResume:(Ljava/lang/Object Ljava/lang/Throwable )Ljava/lang/Object The generated code now looks way different. Methods, which were declared in Kotlin without suspend keyword. Now Kotlin goes one step further and has out and in keyword to use while declaring class which can acts only as producer or consumer. Here a() and c() are calls to ordinary Java In this example, we call b3() suspend function from itself. I have the following code snippet: suspend fun b () ![]() In Kotlin you can use the same modifiers that are found in. ![]() Let’s take a look at the bytecode side of this feature. Visibility modifiers define how your declarations are accessible from other classes and packages. ![]() As we knowįrom the documentation, it is the suspend keyword that was added to the language. The new thing in Kotlin 1.1 is coroutines. ![]() A simple suspend function, and its bytecode. Oracle: We’ve implemented several improvements to speed up the introspection on Level 1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |