Skip to content

Add diagnostic if #endif is followed by any declarations #1833

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

Merged

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Jun 22, 2023

Resolves #1823

@kimdv kimdv requested a review from ahoppen as a code owner June 22, 2023 19:12
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Could you do the same for #sourceLocation?

@kimdv kimdv force-pushed the kimdv/fix-diagnostic-for-declarations-after-endif branch 2 times, most recently from 02619a7 to 1dc643c Compare June 27, 2023 19:20
@kimdv kimdv requested a review from ahoppen June 27, 2023 19:22
@kimdv kimdv force-pushed the kimdv/fix-diagnostic-for-declarations-after-endif branch 2 times, most recently from 3359a6c to c5684e0 Compare June 28, 2023 19:37
@kimdv kimdv force-pushed the kimdv/fix-diagnostic-for-declarations-after-endif branch from c5684e0 to 8b3428f Compare July 7, 2023 20:02
@kimdv
Copy link
Contributor Author

kimdv commented Jul 7, 2023

@swift-ci please test

@kimdv kimdv requested a review from ahoppen July 7, 2023 21:26
@kimdv
Copy link
Contributor Author

kimdv commented Jul 7, 2023

@swift-ci please test windows

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Oh, and one thing that just crossed my mind: Could you also add test cases for statements on the same line as #if, #elseif and #else?

@kimdv kimdv force-pushed the kimdv/fix-diagnostic-for-declarations-after-endif branch from 8b3428f to 74dc3f8 Compare July 8, 2023 14:24
@kimdv
Copy link
Contributor Author

kimdv commented Jul 8, 2023

Oh, and one thing that just crossed my mind: Could you also add test cases for statements on the same line as #if, #elseif and #else?

Good catch!
Test cases added 🙌

@kimdv kimdv requested a review from ahoppen July 8, 2023 14:31
@kimdv
Copy link
Contributor Author

kimdv commented Jul 8, 2023

@swift-ci please test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thanks 👍🏽

@ahoppen ahoppen merged commit 1f4ebd9 into swiftlang:main Jul 10, 2023
@kimdv kimdv deleted the kimdv/fix-diagnostic-for-declarations-after-endif branch July 13, 2023 05:38
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.

Additional declaration allowed on same line after #endif
2 participants