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

Suggestion: optional warning when Invoke is called IMethod without With #220

Open
tg73 opened this issue Sep 15, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@tg73
Copy link

tg73 commented Sep 15, 2023

I suggest that calling Invoke on an IMethod directly, without using With( InvokerOptions ) should report a diagnostic warning. This is in the spirit of more modern C# globalization warnings such as CA1307 ("Specify StringComparison for clarity"). Direct calls without using With have the default context-dependent behaviour which may not be the developer's intent. Using With makes the developer's intent clear. The warning could be suppressed if desired, or indeed it could be severity None by default, increased to Warning according to user preference.

Differing opinions welcome.

@PostSharpBot
Copy link
Member

Hello @tg73, thank you for submitting this issue. We will try to get back to you as soon as possible.
Note to the PostSharp team, this ticket is being tracked in our dashboard under ID TP-33796.

@gfraiteur gfraiteur changed the title Suggestion: calling Invoke on an IMethod should be a warning. Suggestion: optional warning when Invoke is called IMethod without With Sep 20, 2023
@svick svick added the enhancement New feature or request label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants