Skip to content

Macro expansion scopes are inserted at the last character in their insertion range #70740

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

DougGregor
Copy link
Member

@DougGregor DougGregor commented Jan 5, 2024

Macro expansion scope ranges are in terms of characters, so the end of the insertion range is one past the last character of the insertion range. If the last character in the insertion range is also the last character in the enclosing scope, we would build the scope tree incorrectly.

Adjust the position for scope creation to the last character in the insertion range, not one past it. Fixes rdar://120559184, #70733.

…sertion range

Macro expansion scope ranges are in terms of characters, so the end of the
insertion range is one past the last character of the insertion range. If
the last character in the insertion range is also the last character in
the enclosing scope, we would build the scope tree incorrectly.

Adjust the position for scope creation to the last character in the
insertion range, not one past it. Fixes rdar://120559184.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge January 5, 2024 22:35
Copy link
Member

@hborla hborla left a comment

Choose a reason for hiding this comment

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

Thanks!

@hborla
Copy link
Member

hborla commented Jan 5, 2024

This should resolve #70733

@DougGregor DougGregor merged commit 2c2f05e into swiftlang:main Jan 6, 2024
@DougGregor DougGregor deleted the expansion-insertion-not-one-past branch January 6, 2024 01:55
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