Skip to content
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

[ComInterfaceGenerator] Warn on visibility of interface and StringMarshallingCustomType #87065

Merged
merged 23 commits into from
Jun 14, 2023

Conversation

jtschuster
Copy link
Member

@jtschuster jtschuster commented Jun 2, 2023

The generated code is in file scoped classes, so the interface and StringMarshallingCustomType need to be at least internal visibility. These changes warn if that condition isn't met.

Originally, I expected to report a diagnostic, but still generate code for the interface. This required some changes to DiagnosticOr<T> to allow it to hold both a diagnostic and a value if the diagnostic didn't cause failure. In the end those changes weren't necessary, but I left them because I can see them being valuable at some point in the future.

Completes #84662

@ghost
Copy link

ghost commented Jun 2, 2023

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

Builds off #86908, so wait until that is merged to review.

The generated code is in file scoped classes, so the interface and StringMarshallingCustomType need to be at least internal visibility. These changes warn if that condition isn't met.

Completes #84662

Author: jtschuster
Assignees: jtschuster
Labels:

area-System.Runtime.InteropServices

Milestone: -

@jtschuster jtschuster marked this pull request as ready for review June 2, 2023 22:28
@jtschuster jtschuster merged commit 1d9b36d into dotnet:main Jun 14, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: Add StringMarshalling property to GeneratedComInterfaceAttribute
3 participants