Skip to content

CHR0047: A clear declaration is never applied by projection construction (retired)

This rule has been retired and no longer reports anything. It warned that two declarations looked like a clear, compiled, registered, and did nothing:

  • [SetValue<TEvent>(null)], which projection construction dropped where the set-value mappings were built.
  • [ClearWith<TEvent>] on a property or a parameter, which only the class-level form on a nested type was ever read from.

Both are a working scalar clear now: they write the member back to no value every time the event is observed, replay included. Every reading of the rule became false, so it was removed rather than narrowed.

The identifier stays reserved and will never be reused. Anyone who suppressed CHR0047 did so to accept a clear that did nothing; carrying that suppression silently onto a different rule would hide something they never agreed to.

None — the rule is no longer reported.

Nothing. If you suppressed CHR0047 — with #pragma warning disable, a NoWarn, or an .editorconfig entry — remove the suppression: the declaration it covered now does what it says.

One shape still has no correct reading, and CHR0048 reports it: clearing a member that cannot hold null. Declare the member as nullable, or set the value you actually want with [SetValue<TEvent>(...)].