Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Case's Body, not Its Code Block #278

Open
tadbyt opened this issue Feb 26, 2024 · 0 comments
Open

A Case's Body, not Its Code Block #278

tadbyt opened this issue Feb 26, 2024 · 0 comments

Comments

@tadbyt
Copy link
Contributor

tadbyt commented Feb 26, 2024

Location

https://docs.swift.org/swift-book/documentation/the-swift-programming-language/controlflow#Value-Bindings

Description

The first sentence of the pentultimate paragraph in the Language Guide's Value Bindings subsection reads:

After the temporary constants are declared, they can be used within the case’s code block.

Cases don't have code blocks, they have bodies. The distinction is that a code block is a parenthesized sequence of one or more statements, whereas a case body is a sequence of one or more statements. Unlike C and its derivative languages, a code block may not be substituted for a statement.

Correction

Change the first sentence of pentultimate paragraph in the Language Guide's Value Bindings subsection to read:

After the temporary constants are declared, they can be used within the case’s body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant