From 529478ae99130c1fd461d9d47b9568dfcef4f6cb Mon Sep 17 00:00:00 2001 From: Rafael Vuijk Date: Sun, 9 Aug 2026 14:06:12 +0000 Subject: [PATCH] Drop a CS0618 pragma that had nothing left to suppress 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) --- .../UnitTests/Core/Multithreading/SettingsAndThreads.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/Tests/UnitTests/Core/Multithreading/SettingsAndThreads.cs b/Sources/Tests/UnitTests/Core/Multithreading/SettingsAndThreads.cs index d031c247a..99a6eacfd 100644 --- a/Sources/Tests/UnitTests/Core/Multithreading/SettingsAndThreads.cs +++ b/Sources/Tests/UnitTests/Core/Multithreading/SettingsAndThreads.cs @@ -16,8 +16,10 @@ namespace AngouriMath.Tests.Core.Multithreading [Trait("Area", "Core")] public sealed class SettingsAndThreads { - #region Obsolete settings -#pragma warning disable CS0618 // The obsolete method should still work! + // A setting can be scoped two ways: As(value, action) runs the action under it, and + // Set(value) returns a disposable that restores it. Both are supported; each region + // covers one of them. + #region Callback form -- As(value, action) [Fact] public void OSettingValue1() { @@ -86,10 +88,9 @@ public void OWithExceptionInside() } ); } -#pragma warning restore CS0618 // The obsolote method should still work! #endregion - #region Normal settings + #region Disposable form -- Set(value) [Fact] public void SettingValue1() {