Coroutines in Kotlinoperation Continuation interface Continuation{ fun resume(data: P) fun resumeWithException(e: Throwable) }
Library Function (coroutine builder) asyncUI { val image = await(loadImage(url)) Support Continuation interface Continuation { fun resume(data: P) fun resumeWithException(e: Throwable) }
Summary: Goals • Asynchronous programing (and more) – without explicit callbacks CompletableFuture , c: Continuation ) { f.whenComplete { value, throwable -> if (throwable == null) c.resume(value) else c.resumeWithException(throwable) } } async() fun moreWork() = async { println("Work 0 码力 | 39 页 | 1.01 MB | 1 年前3
Kotlin Language Documentation 1.3vararg Deprecation: inner classes of generic classes extending Throwable 38 Inner classes of generic types that inherit from Throwable could violate type-safety in a throw- catch scenario and thus Serializable and can now be used in serializable hierarchies. The Closeable.use function calls Throwable.addSuppressed when an exception is thrown during closing the resource after some other exception — — Floating point to bits conversions — — Regex is now serializable Closeable.use calls Throwable.addSuppressed if available JVM Backend Constructor calls normalization — — 41 preserve-class-initialization0 码力 | 597 页 | 3.61 MB | 1 年前3
Kotlin 1.9.10 官方文档 中文版
exception: kotlin.IllegalStateException: at 0 example.kexe 0x227190 kfun:kotlin.Throwable#(kotlin.String?){} + 96 at 1 example.kexe 0x221e4c kfun:kotlin.Exception# 0x229550 kfun:kotlin.Throwable# (kotlin.String?){} + 96 (/opt/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin- native/runtime/src/main/kotlin/kotlin/Throwable.kt:24:37) at 1 example 0x10a85a8f8 kfun:kotlin.Throwable# (kotlin.String?){} + 88 (/opt/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin- native/runtime/src/main/kotlin/kotlin/Throwable.kt:24:37) at 1 example 0 码力 | 3753 页 | 29.69 MB | 1 年前3
Kotlin Language Documentation 1.9.20for example, in the ArrayList and HashMap collections. The printStackTrace() function from the Throwable class now prints to STDERR instead of STDOUT. Improvements to the Atomics API In Kotlin 1.9.0, Uncaught Kotlin exception: kotlin.IllegalStateException: at 0 example.kexe 0x227190 kfun:kotlin.Throwable#(kotlin.String?){} + 96 at 1 example.kexe 0x221e4c kfun:kotlin.Exception# (kotlin.String example.kexe 0x229550 kfun:kotlin.Throwable# (kotlin.String?){} + 96 (/opt/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Throwable.kt:24:37) at 1 example.kexe 0x22420c 0 码力 | 1299 页 | 32.44 MB | 1 年前3
Kotlin 官方文档中文版 v1.9exception: kotlin.IllegalStateException: at 0 example.kexe 0x227190 kfun:kotlin.Throwable#(kotlin.Strin g?){} + 96 at 1 example.kexe 0x221e4c kfun:kotlin.Exception# (kotlin 0x229550 kfun:kotlin.Throwable# (kotlin.String?) {} + 96 (/opt/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/k otlin/kotlin/Throwable.kt:24:37) at 1 example 0x10a85a8f8 kfun:kotlin.Throwable# (kotlin.String?){ } + 88 (/opt/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/ko tlin/kotlin/Throwable.kt:24:37) at 1 example 0 码力 | 2049 页 | 45.06 MB | 1 年前3
Kotlin 1.2 Language DocumentationKotlin 1.2 and is to be dropped in Kotlin 1.3. Inner classes of generic types that inherit from Throwable could violate type-safety in a throw-catch scenario and thus have been deprecated, with a warning println("Items filled with 5: $items") Deprecation: inner classes of generic classes extending Throwable Deprecation: mutating backing �eld of a read-only property Standard Library Kotlin standard library Serializable and can now be used in serializable hierarchies. The Closeable.use function calls Throwable.addSuppressed when an exception is thrown during closing the resource after some other exception0 码力 | 333 页 | 2.22 MB | 1 年前3
Kotlin language specification
Version 1.9-rfc+0.1p e c i al i z e d i t e r at or t y p e s . . . . . . . . . . . . . . . . . . 85 3. 12 kotlin.Throwable . . . . . . . . . . . . . . . . . . . . . . . . . . 86 3. 13 kotlin.Comparable . . . . . . . . 86 C HAP T E R 3. B UI LT - I N T YP E S AND T HE I R S E M ANT I C S 3 . 1 2 kotlin.Throwable kotlin.Throwable i s t h e b u i l t - i n c l as s i fi e r t y p e t h at i s t h e b as e t y p e of b t y p e of kotlin.Throwable. An y t y p e t h at i s u s e d i n a catch p ar t of t h e try e x p r e s s i on m u s t b e a s u b t y p e of ( or e q u al t o) kotlin.Throwable. I t p r ov i d e s0 码力 | 310 页 | 1.39 MB | 1 年前3
共 7 条
- 1













