Drop a CS0618 pragma that had nothing left to suppress - #845
Merged
Conversation
The region was labelled "Obsolete settings" and wrapped in a disable of CS0618, but As(value, action) is a live, documented member of SettingClass and is not marked obsolete. There are now zero [Obsolete] members anywhere in Sources, so the pragma suppressed nothing -- while still being able to hide the next member that becomes obsolete inside those forty lines. The build is the proof rather than the argument: TreatWarningsAsErrors is on, so with the pragma removed a genuinely obsolete call in that region would now fail the build. It compiles clean. The label was the more misleading half. The two regions do not divide into obsolete and current -- they cover the two ways a setting can be scoped, the callback form and the disposable form, both supported. They now say so. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hygiene found while checking what 2.0 still needs.
Sources/Tests/UnitTests/Core/Multithreading/SettingsAndThreads.cshad a region labelledObsolete settingswrapped in#pragma warning disable CS0618. Neither is true any more:SettingClass.As(T value, Action action)(SettingClass.cs:57) is a live, documented, non-obsolete member. It was never removed.[Obsolete]members anywhere inSources— Remove every deprecated member for 2.0 (#821) #832 removed all 28.So the pragma suppressed nothing, while remaining able to hide the next member that becomes obsolete inside those forty lines. This repository has already been bitten once by a CS0618 pragma masking real usage (#832 found two), which is the argument for not leaving dead ones lying about.
The build is the proof, not the reasoning.
TreatWarningsAsErrorsis on, so with the pragma removed a genuinely obsolete call in that region would now fail the build. It compiles clean, andgrep -c CS0618overSourcesis 0.The label was the more misleading half
The two regions do not divide into "obsolete" and "current". They cover the two ways a setting can be scoped, both supported:
A reader would reasonably have concluded from
#region Obsolete settingsthatAswas deprecated and avoided it. The regions now name the two forms.🤖 Generated with Claude Code