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

Move diagnostics for invalid GeneratedDllImportAttribute usage to generator instead of analyzer #65915

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

elinor-fung
Copy link
Member

Make the generator emit a diagnostic for any methods marked GeneratedDllImport that it is going to ignore. We had diagnostics in a separate analyzer (in the same DLL), but that could be turned off independently from the generator - this makes it so that invalid usage issues can't be missed.

Fixes #62700

@elinor-fung elinor-fung added area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature labels Feb 26, 2022
@elinor-fung elinor-fung added this to the 7.0.0 milestone Feb 26, 2022
@ghost ghost assigned elinor-fung Feb 26, 2022
@ghost
Copy link

ghost commented Feb 26, 2022

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

Issue Details

Make the generator emit a diagnostic for any methods marked GeneratedDllImport that it is going to ignore. We had diagnostics in a separate analyzer (in the same DLL), but that could be turned off independently from the generator - this makes it so that invalid usage issues can't be missed.

Fixes #62700

Author: elinor-fung
Assignees: -
Labels:

area-System.Runtime.InteropServices, source-generator

Milestone: 7.0.0

@elinor-fung
Copy link
Member Author

Faliures are #65890

@elinor-fung elinor-fung merged commit d9eafd0 into dotnet:main Mar 1, 2022
@elinor-fung elinor-fung deleted the invalidUsageDiag branch March 1, 2022 00:57
@danmoseley
Copy link
Member

Perfect thanks @elinor-fung

@ghost ghost locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DllImportGenerator should error if attribute is applied to an extern
3 participants