Skip to content

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Sep 8, 2025

Cherry-pick #3133 into release/6.2

  • Explanation: Nested #if in attribute position were not parsed correctly unless the outer #if contained any attribute. Fix it by correctly propagating "did see attributes" flag from the inner #if parsing
  • Scope: SwiftParser
  • Risk: Low, the change is simple and clear
  • Testing: Added regression test case
  • Issues: rdar://157211447
  • Reviewer: Alex Hoppen

Parse the following '#if' directive as an attribute list for the func
decl.
  ```
  #if condition
  #if condition
  @attr
  #endif
  #endif
  func foo()
  ```

(cherry picked from commit 191392b)
@rintaro rintaro requested a review from a team as a code owner September 8, 2025 22:41
@rintaro
Copy link
Member Author

rintaro commented Sep 8, 2025

@swift-ci Please test

@rintaro rintaro enabled auto-merge September 9, 2025 01:35
@rintaro
Copy link
Member Author

rintaro commented Sep 9, 2025

@swift-ci Please test Windows

@rintaro rintaro merged commit 4799286 into swiftlang:release/6.2 Sep 10, 2025
30 checks passed
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.

2 participants