Skip to content

[Macros] Unpack DiagnosticsError into separate diagnostics #64744

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

Fixes rdar://107289985.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@@ -805,6 +813,15 @@ func expandAttachedMacroInProcess(
print("\(macroPtr) does not conform to any known attached macro protocol")
return nil
}
} catch let diagsError as DiagnosticsError {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could just call addDiagnostics in the block below instead, which would better match things on the swift-syntax side. Alternatively we could have a non-throwing extension that does this on the swift-syntax side as well.

That would also avoid repeating the from macro bits which is ... kind of nice 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you're right, I'm doing this in #64785

@DougGregor DougGregor merged commit efd0ca6 into swiftlang:main Mar 30, 2023
@DougGregor DougGregor deleted the macros-unpack-diagnosticserror branch March 30, 2023 01:47
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