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

[SR-11627] Element type of SwitchCaseListSyntax #412

Closed
swift-ci opened this issue Oct 17, 2019 · 2 comments
Closed

[SR-11627] Element type of SwitchCaseListSyntax #412

swift-ci opened this issue Oct 17, 2019 · 2 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-11627
Radar None
Original Reporter kitasuke (JIRA User)
Type Improvement
Status Closed
Resolution Won't Do
Additional Detail from JIRA
Votes 0
Component/s SwiftSyntax
Labels Improvement
Assignee kitasuke (JIRA)
Priority Medium

md5: 588625fa8f50dbd5c455311c88deb9cd

Issue Description:

SwitchCaseList syntax node currently has Syntax type for element.

# switch-case-list -> switch-case switch-case-list?
Node('SwitchCaseList', kind='SyntaxCollection',
  element='Syntax', element_name='SwitchCase',
  element_choices=['SwitchCase', 'IfConfigDecl']),

However, I think we can make it SwitchCase instead of Syntax. Is there any case for SwitchCaseList to have multiple types of Syntax other than SwitchCase?

@belkadan
Copy link

As noted, it has IfConfigDecls too:

switch screenSize {
#if os(iOS)
  case .iphoneSE: …
  case .iphone7: …
  case .iphone7Plus: …
  case .iphoneX: …
  case .iphoneXPlus: …
#elseif os(watchOS)
  case .small: …
  case .large: …
#endif
  default: …
}

@swift-ci
Copy link
Contributor Author

Comment by Yusuke Kita (JIRA)

Sorry, I missed that part. Now it makes sense.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
adevress pushed a commit to adevress/swift-syntax that referenced this issue Jan 14, 2024
Fix recent breakages due to changes in swift-syntax main.
This issue was closed.
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

2 participants