S3L0009: No this qualifier¶
this. is written only where a local or a parameter shadows the member.
| Category | Snail |
| Severity | warning — an error under TreatWarningsAsErrors, which every Snail project builds with |
| Analyzer | Simplification in Snail.Sdk.Analyzers |
| Code fix | Remove 'this.', Fix All supported |
What it reports¶
this.Member where looking up Member at that point finds the same member and no local, parameter or range variable
of that name. This is IDE0003, which a command-line build does not run even when named as an error, so the SDK carries
it as a rule of its own.
What it leaves alone¶
this. where a local or parameter of the same name would otherwise win, and extension method calls through this..
Why¶
The guidelines ask for this. only where it is needed; written everywhere, it hides the one place
where it matters.
How to fix¶
Remove this.. The code fix does it; Fix All applies it to a document, project or solution.
Suppressing it¶
Fix the code rather than silence the rule: the rule is part of the standard every Snail repository keeps. Where one place truly must differ, suppress that place and say why:
[SuppressMessage("Snail", "S3L0009:No this qualifier", Justification = "<why this place differs>")]
A NoWarn in a project or props file would hide the rule from every new line too; the
conformance check reports one as migration debt (S3LC0017).