Skip to content

Fix Swift 6.2 parser compatibility for underscore property access#8

Open
objectiveous wants to merge 1 commit into
mlalma:mainfrom
objectiveous:swift-6.2-compatibility
Open

Fix Swift 6.2 parser compatibility for underscore property access#8
objectiveous wants to merge 1 commit into
mlalma:mainfrom
objectiveous:swift-6.2-compatibility

Conversation

@objectiveous
Copy link
Copy Markdown

Summary

  • Escape _ property names with backticks in closure contexts to fix Swift 6.2's new parser requirements
  • Without this fix, builds fail with "Expected name in member access" errors

Changes

The Swift 6.2 parser requires backtick escaping for property names that are _ (underscore) when accessed in closures. Changed 7 occurrences in mergeTokens() function:

  • $0._.stress$0.\_`.stress`
  • $0._.currency$0.\_`.currency`
  • $0._.rating$0.\_`.rating`
  • token._.prespacetoken.\_`.prespace`
  • $0._.num_flags$0.\_`.num_flags`
  • tokens.first?._.is_headtokens.first?.\_`.is_head`
  • tokens.first?._.prespacetokens.first?.\_`.prespace`

Test plan

  • Verified build succeeds with Swift 6.2.3 (Xcode default toolchain)

🤖 Generated with Claude Code

Swift 6.2's new parser requires backtick escaping for the `_` property
name in closure contexts. Without this fix, the build fails with:
"Expected name in member access" errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
yocontra added a commit to veil-labs-inc/ApparishSwift that referenced this pull request Mar 31, 2026
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

Successfully merging this pull request may close these issues.

1 participant