swift-book
swift-book copied to clipboard
Update for async and throwing getters [SE-0310]
Description The changes listed in SE-0310 are not contained in the official language specification.
getter-effects → "throws"
getter-effects → "async" "throws"?
Rules getter-clause
and getter-keyword-clause
are missing the getter-effects
rule in the current spec:
getter-clause → attributes? mutation-modifier? "get" getter-effects? code-block
getter-keyword-clause → attributes? mutation-modifier? "get" getter-effects?
I couldn't figure out if the spec is on GitHub. If you point me to it, I'd be glad to make the change.
rdar://77234189
@jansorg The language reference is maintained in the https://github.com/apple/swift-book repository.
@hamishknight Please transfer this issue.
cc @amartini51
Copying my initial assessment of documentation impact from rdar://77234189 below. Updated the title because it's not just the grammar that needs to be updated.
In the Properties > Computed Properties section (1) we should add a forward reference to the fact that getters can be async and throw. In the Error Handling chapter, we'd want a section about throwing getters parallel to the existing section (2) about throwing functions. In the Concurrency chapter, we can probably mention async getters in passing in the section (3) about async functions.
1: https://docs.swift.org/swift-book/LanguageGuide/Properties.html#ID259 2: https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html#ID510 3: https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html#ID639