[SE-0521] Improved Syntax for Optionals of Opaque and Existential Types (opens in new tab)

안녕하세요. 그린입니다 이번 포스팅에서는 SE-0521 — Opaque 및 Existential 타입의 Optional 문법 개선에 대해 정리해보겠습니다 Intro Proposal: SE-0521 Author: Tony Allevato Review Manager: Frederick Kellison-Linn Status: Accepted with modifications Motivation Swift에서 some P와 any P는 이미 익숙한 문법이죠. 개발자들은 자연스럽게 Int?, String?처럼 some P? 또는 any P?라고 쓰고 싶어 합니다. 그런데 현재 이 코드는 컴파일 에러가 발생합니다 func fetchUser() -> some Identifiable? // ❌ error var handler: (any EventHandler)? // ✅ 이렇게 써야 함 var handler: any EventHandler? // ❌ error 이유는 파싱 우선순위 때문입니다...

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