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

Analyze MEF exports for correctness #79

Open
AArnott opened this issue Apr 4, 2018 · 1 comment
Open

Analyze MEF exports for correctness #79

AArnott opened this issue Apr 4, 2018 · 1 comment
Assignees

Comments

@AArnott
Copy link
Member

AArnott commented Apr 4, 2018

From @dgriffen on April 4, 2018 17:5

There should be a diagnostic checking if Export declarations are correct. For example:

[Export(typeof(IBar))]
public class Foo { }

This should be flagged as incorrect since Foo does not implement IBar

Copied from original issue: microsoft/VSSDK-Analyzers#43

@AArnott
Copy link
Member Author

AArnott commented Apr 4, 2018

Strictly speaking, the exported type is its type identity, which need to be implemented by the exported object. So this isn't actually an error.
However it seems reasonable to report this as a warning since it is likely to be an authoring mistake.
We don't have any analyzers in vs-mef at this point, but adding them sounds valuable.

@AArnott AArnott self-assigned this Feb 18, 2020
@AArnott AArnott added this to the v16.5 milestone Feb 18, 2020
@AArnott AArnott removed this from the v16.5 milestone Oct 2, 2020
@AArnott AArnott closed this as completed in d8b3fc0 Jun 7, 2022
@AArnott AArnott reopened this Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant