Avatar
Avatar
shiz
はい、最初のbetaは(WWDCのビデオも)まだ古いままのようです。 For reference, here is the full list of concurrency-related proposals included in the first beta. Note, in some cases there can be lag between a proposal being updated in open source and it making it into the build, so some proposal amendments are not reflected in the first beta. For example, beta 1 still requires async { } to launch an unstructured async task rather than the now-proposed Task { }. https://forums.swift.org/t/swift-concurrency-feedback-wanted/49336
この話、 Task になったら _ = Task { } が強制されるかと思ったけど、イニシャライザにも @discardableResult 付けられるんですね。考えたことなかった。 @swift-5.4.3 struct Foo { @discardableResult init(_ handler: () -> Void) { handler() } } Foo { print("hello") }