Skip to content

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

Merged
elinor-fung merged 1 commit into
dotnet:mainfrom
elinor-fung:invalidUsageDiag
Mar 1, 2022
Merged

elinor-fung merged 1 commit into
dotnet:mainfrom
elinor-fung:invalidUsageDiag

Conversation

@elinor-fung

Copy link
Copy Markdown
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

ghost commented Feb 26, 2022

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor

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