Skip to content

DiagnosticEngine: Print the ID of the wrapped, not wrapper, diagnostic #80260

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 2 commits into from
Mar 25, 2025

Conversation

AnthonyLatsis
Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis commented Mar 25, 2025

-debug-diagnostic-names always favors the effective ID of an emitted diagnostic. This is not ideal for wrapper diagnostics because they are an implementation detail of the diagnostic engine:

protocol P {
    func test(_: () -> Void)
}

struct S: P {
    func test(_: @Sendable () -> Void) {}
}
warning: sendability of function types in instance method 'test' does not match requirement in protocol 'P'; this is an error in the Swift 6 language mode [error_in_swift_lang_mode]

What is most relevant to both a compiler engineer and developer is the identity of the underlying diagnostic the engine was instructed to emit by a client.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test Linux

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test Windows

@AnthonyLatsis AnthonyLatsis enabled auto-merge March 25, 2025 22:30
@AnthonyLatsis AnthonyLatsis merged commit a95785c into swiftlang:main Mar 25, 2025
3 checks passed
@AnthonyLatsis AnthonyLatsis deleted the eutrema-japonicum branch March 26, 2025 00:14
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.

3 participants