Created
February 13, 2023 05:29
-
-
Save inamiy/76506d91578c98fe5385486f06fd7563 to your computer and use it in GitHub Desktop.
Didn't know `try x = ...` was possible. https://twitter.com/inamiy/status/1623625122652491776
This file contains 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
func foo() throws -> Int { | |
1 | |
} | |
func fooAsync() async throws -> Int { | |
1 | |
} | |
class Foo { | |
var x: Int = 0 | |
func bar() async throws { | |
try x = foo() | |
try await x = fooAsync() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment