[SE-0520] Discardable result use in Task initializers (opens in new tab)

안녕하세요. 그린입니다 이번 포스팅에서는 SE-0520 — Task 이니셜라이저에서의 Discardable result 처리에 대해 정리해보겠습니다 Intro Proposal: SE-0520 Author: Konrad 'ktoso' Malawski Status: Accepted Motivation 현재 아래 코드는 아무런 경고 없이 컴파일됩니다. Task { // no warning try boom() } print("Yay!") 간단한 예시에서는 에러를 놓쳤다는 게 명확하지만, 실제 코드베이스에서는 노이즈가 많아서 에러를 조용히 무시했다는 사실을 놓치기 쉽거든요. 이 문제는 Swift 커뮤니티에서 여러 차례 제기되었습니다. Task initializer with throwing closure swallows error Pitch: non-discardable throwing tasks Pitch: Improved error handling in unstructured task...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help