Skip to content

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 17, 2025

I think the guard is a lot easier to read here, noticed while reviewing #3171.

I think the guard is a lot easier to read here, noticed while reviewing swiftlang#3171.
@ahoppen
Copy link
Member Author

ahoppen commented Oct 17, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Oct 17, 2025

@swift-ci Please test macOS

rintaro
rintaro previously approved these changes Oct 17, 2025
Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I find if !self.at(.atSign) easier and generally just use guard for introducing new variables, but 🤷


// If we don't have attributes, then it cannot be an accessor block.
if nextToken.rawTokenKind != .atSign {
guard self.at(.atSign) else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, nextToken is peek(). This is a behavior change.

@rintaro rintaro dismissed their stale review October 17, 2025 16:55

Misapproved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants