Skip to content

Commit 59947e3

Browse files
Drop a CS0618 pragma that had nothing left to suppress (#845)
The region was labelled "Obsolete settings" and wrapped in a disable of CS0618, but SettingClass.As(T, Action) is a live, documented member 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. TreatWarningsAsErrors is on, so with the pragma removed a genuinely obsolete call in that region would fail the build. It compiles clean. 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.
1 parent c09055f commit 59947e3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎Sources/Tests/UnitTests/Core/Multithreading/SettingsAndThreads.cs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ namespace AngouriMath.Tests.Core.Multithreading
1616
[Trait("Area", "Core")]
1717
public sealed class SettingsAndThreads
1818
{
19-
#region Obsolete settings
20-
#pragma warning disable CS0618 // The obsolete method should still work!
19+
// A setting can be scoped two ways: As(value, action) runs the action under it, and
20+
// Set(value) returns a disposable that restores it. Both are supported; each region
21+
// covers one of them.
22+
#region Callback form -- As(value, action)
2123
[Fact]
2224
public void OSettingValue1()
2325
{
@@ -86,10 +88,9 @@ public void OWithExceptionInside()
8688
}
8789
);
8890
}
89-
#pragma warning restore CS0618 // The obsolote method should still work!
9091
#endregion
9192

92-
#region Normal settings
93+
#region Disposable form -- Set(value)
9394
[Fact]
9495
public void SettingValue1()
9596
{

0 commit comments

Comments
 (0)