Closed wtg-mg8 closed 1 month ago
Duplicate of #205.
We already have unit tests and logic that account for this:
partial
keyword is present on a method declaration:
https://github.com/WiseTechGlobal/WTG.Analyzers/blob/02fccc99605e35905f938586f188ad490282b3ac/src/WTG.Analyzers/Analyzers/Visibility/VisibilityAnalyzer.cs#L50-L51This was fixed in #206 which shipped in WTG.Analyzers package version 3.7.2.
If you're still using an older analyzers version I suggest updating. 😉
[like] Oleh Miroshnychenko reacted to your message:
From: Yaakov @.> Sent: Monday, July 1, 2024 8:20:45 AM To: WiseTechGlobal/WTG.Analyzers @.> Cc: Oleh Miroshnychenko @.>; Mention @.> Subject: Re: [WiseTechGlobal/WTG.Analyzers] WTG1001:DoNotUsePrivateKeyword should ignore partial methods with non-void return types (Issue #220)
You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification âš CAUTION: This email originated from outside of the organisation. Do not click on links or open attachments in emails unless you are sure it is from a trusted sender and was expected.
Duplicate of #205https://github.com/WiseTechGlobal/WTG.Analyzers/issues/205.
We already have unit tests and logic that account for this:
This was fixed in #206https://github.com/WiseTechGlobal/WTG.Analyzers/pull/206 which shipped in WTG.Analyzers package version 3.7.2.
If you're still using an older analyzers version I suggest updating. 😉
— Reply to this email directly, view it on GitHubhttps://github.com/WiseTechGlobal/WTG.Analyzers/issues/220#issuecomment-2199531909, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDHSNMRGVZBM5BPFS3MVJ3TZKEGN3AVCNFSM6AAAAABJ67G7EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJZGUZTCOJQHE. You are receiving this because you were mentioned.Message ID: @.***>
WTG1001:Do not use the 'private' keyword
analyzer is raising a diagnostic for partial methods to remove theprivate
accessibility modifier when doing so causes the compiler to emit errorCS8796: Partial method must have accessibility modifiers because it has a non-void return type
.Given the following class
Compiler will error: CS8796: Partial method 'Testing.AbcOrDefGeneratedRegex()' must have accessibility modifiers because it has a non-void return type.
Expected outcome: WTG1001 analyzer should not prompt to remove private from non-void return partial methods.
Forgot to mention: this was raised to me by Oleh Miroshnychenko (@oleh-wtg).
Corresponds to WI00764889