Skip to content

Make Diagnostic initializers public #130

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
merged 1 commit into from
Jun 11, 2019
Merged

Make Diagnostic initializers public #130

merged 1 commit into from
Jun 11, 2019

Conversation

MaxDesiatov
Copy link
Contributor

For tools that use SwiftSyntax, it's quite useful to be able to emit their own diagnostics while reusing the Diagnostic type from SwiftSyntax. Both Diagnostic and its Builder type are public, and properties of Diagnostic are public too, but initializers are implicitly internal. This means that instances of Diagnostic can't be created by tools using SwiftSyntax. I hope this can be fixed with this simple change.

For tools that use SwiftSyntax, it's quite useful to be able to emit their own diagnostics while reusing the `Diagnostic` type from SwiftSyntax. Both `Diagnostic` and its `Builder` type are `public`, and properties of `Diagnostic` are `public` too, but initializers are implicitly `internal`. This means that instances of `Diagnostic` can't be created by tools using SwiftSyntax. I hope this can be fixed with this simple change.
Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

@MaxDesiatov Welcome to the project! Allowing SwiftSyntax clients to use the same diagnostic type seems beneficial to me.

@nkcsgexi
Copy link
Contributor

@swift-ci please test

@nkcsgexi nkcsgexi merged commit 0c74466 into swiftlang:master Jun 11, 2019
adevress pushed a commit to adevress/swift-syntax that referenced this pull request Jan 14, 2024
Swap order of .close and .break around tuple exprs.
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