浏览代码

Feature/1898 fix diagnostics (#1928)

Ian Griffiths 2 年之前
父节点
当前提交
b0113d5db3
共有 100 个文件被更改,包括 648 次插入693 次删除
  1. 2 2
      .editorconfig
  2. 31 5
      Rx.NET/Source/Directory.build.props
  3. 0 222
      Rx.NET/Source/Rx.ruleset
  4. 10 2
      Rx.NET/Source/System.Reactive.sln
  5. 230 0
      Rx.NET/Source/analyzers.globalconfig
  6. 16 0
      Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/Benchmarks.System.Reactive.csproj
  7. 2 2
      Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/CombineLatestBenchmark.cs
  8. 2 2
      Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/ComparisonAsyncBenchmark.cs
  9. 1 1
      Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/ComparisonBenchmark.cs
  10. 4 2
      Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/PrependVsStartWtihBenchmark.cs
  11. 2 2
      Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/ZipBenchmark.cs
  12. 70 0
      Rx.NET/Source/src/.editorconfig
  13. 1 1
      Rx.NET/Source/src/Microsoft.Reactive.Testing/ColdObservable.cs
  14. 3 3
      Rx.NET/Source/src/Microsoft.Reactive.Testing/GlobalSuppressions.cs
  15. 2 2
      Rx.NET/Source/src/Microsoft.Reactive.Testing/HotObservable.cs
  16. 6 2
      Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj
  17. 3 3
      Rx.NET/Source/src/Microsoft.Reactive.Testing/MockObserver.cs
  18. 8 0
      Rx.NET/Source/src/Microsoft.Reactive.Testing/ReactiveTest.cs
  19. 1 1
      Rx.NET/Source/src/Microsoft.Reactive.Testing/Recorded.cs
  20. 1 1
      Rx.NET/Source/src/Microsoft.Reactive.Testing/Subscription.cs
  21. 1 5
      Rx.NET/Source/src/System.Reactive.Observable.Aliases/Observable.Aliases.cs
  22. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/AsyncLock.cs
  23. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayer.cs
  24. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs
  25. 2 6
      Rx.NET/Source/src/System.Reactive/Concurrency/CurrentThreadScheduler.cs
  26. 2 2
      Rx.NET/Source/src/System.Reactive/Concurrency/DefaultScheduler.cs
  27. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs
  28. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/HistoricalScheduler.cs
  29. 3 9
      Rx.NET/Source/src/System.Reactive/Concurrency/ImmediateScheduler.cs
  30. 6 7
      Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.TimerQueue.cs
  31. 2 2
      Rx.NET/Source/src/System.Reactive/Concurrency/NewThreadScheduler.cs
  32. 2 0
      Rx.NET/Source/src/System.Reactive/Concurrency/ScheduledItem.cs
  33. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Async.cs
  34. 2 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.cs
  35. 5 12
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.cs
  36. 5 5
      Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerOperation.cs
  37. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerWrapper.cs
  38. 3 6
      Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.ObserveOn.cs
  39. 1 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.Synchronize.cs
  40. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/TaskObservationOptions.cs
  41. 3 3
      Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs
  42. 2 2
      Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.Windows.cs
  43. 2 2
      Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs
  44. 1 2
      Rx.NET/Source/src/System.Reactive/Concurrency/VirtualTimeScheduler.cs
  45. 4 0
      Rx.NET/Source/src/System.Reactive/Diagnostics/CodeAnalysis/NullableAttributes.cs
  46. 1 1
      Rx.NET/Source/src/System.Reactive/Disposables/BooleanDisposable.cs
  47. 2 2
      Rx.NET/Source/src/System.Reactive/Disposables/CompositeDisposable.cs
  48. 7 7
      Rx.NET/Source/src/System.Reactive/Disposables/Disposable.Utils.cs
  49. 1 1
      Rx.NET/Source/src/System.Reactive/Disposables/Disposable.cs
  50. 0 1
      Rx.NET/Source/src/System.Reactive/Disposables/RefCountDisposable.cs
  51. 1 6
      Rx.NET/Source/src/System.Reactive/Disposables/ScheduledDisposable.cs
  52. 12 0
      Rx.NET/Source/src/System.Reactive/Disposables/SingleAssignmentDisposableValue.cs
  53. 2 0
      Rx.NET/Source/src/System.Reactive/Disposables/StableCompositeDisposable.cs
  54. 0 2
      Rx.NET/Source/src/System.Reactive/EnlightenmentProvider.cs
  55. 3 1
      Rx.NET/Source/src/System.Reactive/EventPattern.cs
  56. 1 1
      Rx.NET/Source/src/System.Reactive/EventPatternSourceBase.cs
  57. 31 191
      Rx.NET/Source/src/System.Reactive/GlobalSuppressions.cs
  58. 1 2
      Rx.NET/Source/src/System.Reactive/IEventSource.cs
  59. 4 0
      Rx.NET/Source/src/System.Reactive/Internal/ExceptionServices.Default.cs
  60. 1 3
      Rx.NET/Source/src/System.Reactive/Internal/ExceptionServices.cs
  61. 4 0
      Rx.NET/Source/src/System.Reactive/Internal/ExceptionServicesImpl.cs
  62. 1 3
      Rx.NET/Source/src/System.Reactive/Internal/HostLifecycleService.cs
  63. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/ImmutableList.cs
  64. 3 9
      Rx.NET/Source/src/System.Reactive/Internal/PriorityQueue.cs
  65. 0 2
      Rx.NET/Source/src/System.Reactive/Internal/QueryServices.cs
  66. 2 17
      Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs
  67. 3 3
      Rx.NET/Source/src/System.Reactive/Internal/ScheduledObserver.cs
  68. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs
  69. 4 11
      Rx.NET/Source/src/System.Reactive/Internal/SystemClock.cs
  70. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/TailRecursiveSink.cs
  71. 2 2
      Rx.NET/Source/src/System.Reactive/Internal/TaskExtensions.cs
  72. 1 1
      Rx.NET/Source/src/System.Reactive/Joins/ActivePlan.cs
  73. 3 3
      Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.NAry.cs
  74. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.NAry.tt
  75. 10 10
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Binding.cs
  76. 4 0
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Blocking.cs
  77. 10 0
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Creation.cs
  78. 2 0
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs
  79. 2 0
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs
  80. 2 0
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.cs
  81. 3 8
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Queryable.cs
  82. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/AddRef.cs
  83. 3 3
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Aggregate.cs
  84. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/All.cs
  85. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Amb.cs
  86. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Any.cs
  87. 4 4
      Rx.NET/Source/src/System.Reactive/Linq/Observable/AppendPrepend.cs
  88. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/AsObservable.cs
  89. 10 10
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Average.cs
  90. 19 19
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs
  91. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Case.cs
  92. 3 3
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Cast.cs
  93. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Catch.cs
  94. 14 14
      Rx.NET/Source/src/System.Reactive/Linq/Observable/CombineLatest.NAry.cs
  95. 4 4
      Rx.NET/Source/src/System.Reactive/Linq/Observable/CombineLatest.cs
  96. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Concat.cs
  97. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Contains.cs
  98. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Count.cs
  99. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/DefaultIfEmpty.cs
  100. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Defer.cs

+ 2 - 2
.editorconfig

@@ -64,7 +64,7 @@ dotnet_style_predefined_type_for_member_access = true:suggestion
 dotnet_style_readonly_field = true:warning
 
 # Suggest more modern language features when available
-dotnet_style_object_initializer = true:suggestion
+dotnet_style_object_initializer = true:silent
 dotnet_style_collection_initializer = true:suggestion
 dotnet_style_coalesce_expression = true:suggestion
 dotnet_style_null_propagation = true:suggestion
@@ -74,7 +74,7 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
 dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
 dotnet_style_prefer_conditional_expression_over_return = false
 dotnet_style_prefer_conditional_expression_over_assignment = false
-dotnet_style_prefer_auto_properties = true:suggestion
+dotnet_style_prefer_auto_properties = true:silent
 
 # Parentheses
 dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent

+ 31 - 5
Rx.NET/Source/Directory.build.props

@@ -13,16 +13,11 @@
     <DefaultLanguage>en-US</DefaultLanguage>
     <IncludeSymbols>false</IncludeSymbols>
     <IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
-    <CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Rx.ruleset</CodeAnalysisRuleSet>
     <GeneratePackageOnBuild Condition=" '$(IsTestProject)' != 'true' and '$(CreatePackage)' == 'true' ">true</GeneratePackageOnBuild>
     <PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
     <EmbedUntrackedSources>true</EmbedUntrackedSources>
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
     <LangVersion>latest</LangVersion>
-
-    <!-- Get diagnostics back to the level that the .NET 5.0 SDK had for now. Fix these properly before release. -->
-    <AnalysisLevel>5-Default</AnalysisLevel>
-    <NoWarn>$(NoWarn);CS8600;CS8602;CS8603;CS8604;CS8632;CA1000;CA1003;CA1014;CA1019;CA1033;CA1045;CA1051;CA1052;CA1063;CA1067;CA1068;CA1507;CA1707;CA1711;CA1716;CA1720;CA1806;CA1815;CA1816;CA1822;CA1825;CA1840;CA1845;CA2016;CA2109;CA2201;CA2211;CA2213;CA2249;IDE0003;IDE0016;IDE0017;IDE0018;IDE0019;IDE0020;IDE0031;IDE0032;IDE0034;IDE0037;IDE0038;IDE0039;IDE0040;IDE0044;IDE0051;IDE0052;IDE0056;IDE0057;IDE0059;IDE0060;IDE0062;IDE0063;IDE0071;IDE0074;IDE0075;IDE0076;IDE0077;IDE0079;IDE0083;IDE0090;IDE0180;IDE0270;IDE0280;IDE1006;IDE1056</NoWarn>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)' != 'Debug'">
@@ -43,4 +38,35 @@
     <PackageReference Include="coverlet.collector" Version="3.2.0" />
   </ItemGroup>
 
+  <PropertyGroup>
+    <AnalysisLevelDesign>7.0-default</AnalysisLevelDesign>
+    <AnalysisLevelNaming>7.0-all</AnalysisLevelNaming>
+    <AnalysisLevelPerformance>7.0-all</AnalysisLevelPerformance>
+
+    <!-- Enable analyzers on older targets. -->
+    <EnableNETAnalyzers>true</EnableNETAnalyzers>
+
+    <!--
+    Disable diagnostics:
+    CA1001 - types holding disposable fields should implement IDisposable. See next item.
+    CA2213 - IDisposable types should Dispose any IDisposable fields. This rule finds over 600
+                examples! These are all in subtle multithreaded or async code. Some of them appear
+                not to be real problems. For example, there are places where schedulers retain
+                references to IDisposable work items, but that IDisposable interfaces is only there
+                to enable application code to cancel scheduled work, so it's not Rx's place to call
+                Dispose. And there are more subtle cases where disposal is deferred to give threads
+                a chance to shut down. Each of these likely needs individual review:
+                https://github.com/dotnet/reactive/issues/1927
+
+    IDE0056 - Use of index/range syntax - relevant types not available on all targets, so we can't
+    IDE0057     do this.
+    -->
+    <!-- Get diagnostics back to the level that the .NET 5.0 SDK had for now. Fix these properly before release. -->
+    <NoWarn>$(NoWarn);CA1001;CA2213;IDE0056;IDE0057</NoWarn>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)analyzers.globalconfig" />
+  </ItemGroup>
+
 </Project>

+ 0 - 222
Rx.NET/Source/Rx.ruleset

@@ -1,222 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RuleSet Name="Rx Rule Set" Description=" " ToolsVersion="10.0">
-  <Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
-    <Rule Id="CA1000" Action="Warning" />
-    <Rule Id="CA1002" Action="Warning" />
-    <Rule Id="CA1003" Action="Warning" />
-    <Rule Id="CA1004" Action="Warning" />
-    <Rule Id="CA1007" Action="Warning" />
-    <Rule Id="CA1008" Action="Warning" />
-    <Rule Id="CA1009" Action="Warning" />
-    <Rule Id="CA1010" Action="Warning" />
-    <Rule Id="CA1012" Action="Warning" />
-    <Rule Id="CA1013" Action="Warning" />
-    <Rule Id="CA1014" Action="Warning" />
-    <Rule Id="CA1016" Action="Warning" />
-    <Rule Id="CA1017" Action="Warning" />
-    <Rule Id="CA1018" Action="Warning" />
-    <Rule Id="CA1019" Action="Warning" />
-    <Rule Id="CA1020" Action="Warning" />
-    <Rule Id="CA1021" Action="Warning" />
-    <Rule Id="CA1023" Action="Warning" />
-    <Rule Id="CA1024" Action="Warning" />
-    <Rule Id="CA1025" Action="Warning" />
-    <Rule Id="CA1026" Action="Warning" />
-    <Rule Id="CA1027" Action="Warning" />
-    <Rule Id="CA1028" Action="Warning" />
-    <Rule Id="CA1030" Action="Warning" />
-    <Rule Id="CA1032" Action="Warning" />
-    <Rule Id="CA1033" Action="Warning" />
-    <Rule Id="CA1034" Action="Warning" />
-    <Rule Id="CA1035" Action="Warning" />
-    <Rule Id="CA1036" Action="Warning" />
-    <Rule Id="CA1038" Action="Warning" />
-    <Rule Id="CA1039" Action="Warning" />
-    <Rule Id="CA1040" Action="Warning" />
-    <Rule Id="CA1041" Action="Warning" />
-    <Rule Id="CA1043" Action="Warning" />
-    <Rule Id="CA1044" Action="Warning" />
-    <Rule Id="CA1045" Action="Warning" />
-    <Rule Id="CA1046" Action="Warning" />
-    <Rule Id="CA1047" Action="Warning" />
-    <Rule Id="CA1048" Action="Warning" />
-    <Rule Id="CA1049" Action="Warning" />
-    <Rule Id="CA1050" Action="Warning" />
-    <Rule Id="CA1051" Action="Warning" />
-    <Rule Id="CA1052" Action="Warning" />
-    <Rule Id="CA1053" Action="Warning" />
-    <Rule Id="CA1054" Action="Warning" />
-    <Rule Id="CA1055" Action="Warning" />
-    <Rule Id="CA1056" Action="Warning" />
-    <Rule Id="CA1057" Action="Warning" />
-    <Rule Id="CA1058" Action="Warning" />
-    <Rule Id="CA1059" Action="Warning" />
-    <Rule Id="CA1060" Action="Warning" />
-    <Rule Id="CA1061" Action="Warning" />
-    <Rule Id="CA1062" Action="Warning" />
-    <Rule Id="CA1063" Action="Warning" />
-    <Rule Id="CA1064" Action="Warning" />
-    <Rule Id="CA1065" Action="Warning" />
-    <Rule Id="CA1300" Action="Warning" />
-    <Rule Id="CA1301" Action="Warning" />
-    <Rule Id="CA1302" Action="Warning" />
-    <Rule Id="CA1303" Action="Warning" />
-    <Rule Id="CA1304" Action="Warning" />
-    <Rule Id="CA1305" Action="Warning" />
-    <Rule Id="CA1306" Action="Warning" />
-    <Rule Id="CA1307" Action="Warning" />
-    <Rule Id="CA1308" Action="Warning" />
-    <Rule Id="CA1309" Action="Warning" />
-    <Rule Id="CA1400" Action="Warning" />
-    <Rule Id="CA1401" Action="Warning" />
-    <Rule Id="CA1402" Action="Warning" />
-    <Rule Id="CA1403" Action="Warning" />
-    <Rule Id="CA1404" Action="Warning" />
-    <Rule Id="CA1405" Action="Warning" />
-    <Rule Id="CA1406" Action="Warning" />
-    <Rule Id="CA1407" Action="Warning" />
-    <Rule Id="CA1408" Action="Warning" />
-    <Rule Id="CA1409" Action="Warning" />
-    <Rule Id="CA1410" Action="Warning" />
-    <Rule Id="CA1411" Action="Warning" />
-    <Rule Id="CA1412" Action="Warning" />
-    <Rule Id="CA1413" Action="Warning" />
-    <Rule Id="CA1414" Action="Warning" />
-    <Rule Id="CA1415" Action="Warning" />
-    <Rule Id="CA1600" Action="Warning" />
-    <Rule Id="CA1601" Action="Warning" />
-    <Rule Id="CA1700" Action="Warning" />
-    <Rule Id="CA1701" Action="Warning" />
-    <Rule Id="CA1702" Action="Warning" />
-    <Rule Id="CA1703" Action="Warning" />
-    <Rule Id="CA1704" Action="Warning" />
-    <Rule Id="CA1707" Action="Warning" />
-    <Rule Id="CA1708" Action="Warning" />
-    <Rule Id="CA1709" Action="Warning" />
-    <Rule Id="CA1710" Action="Warning" />
-    <Rule Id="CA1711" Action="Warning" />
-    <Rule Id="CA1712" Action="Warning" />
-    <Rule Id="CA1713" Action="Warning" />
-    <Rule Id="CA1714" Action="Warning" />
-    <Rule Id="CA1715" Action="Warning" />
-    <Rule Id="CA1716" Action="Warning" />
-    <Rule Id="CA1717" Action="Warning" />
-    <Rule Id="CA1719" Action="Warning" />
-    <Rule Id="CA1720" Action="Warning" />
-    <Rule Id="CA1721" Action="Warning" />
-    <Rule Id="CA1722" Action="Warning" />
-    <Rule Id="CA1724" Action="Warning" />
-    <Rule Id="CA1725" Action="Warning" />
-    <Rule Id="CA1726" Action="Warning" />
-    <Rule Id="CA1800" Action="Warning" />
-    <Rule Id="CA1801" Action="Warning" />
-    <Rule Id="CA1802" Action="Warning" />
-    <Rule Id="CA1804" Action="Warning" />
-    <Rule Id="CA1806" Action="Warning" />
-    <Rule Id="CA1809" Action="Warning" />
-    <Rule Id="CA1810" Action="Warning" />
-    <Rule Id="CA1811" Action="Warning" />
-    <Rule Id="CA1812" Action="Warning" />
-    <Rule Id="CA1813" Action="Warning" />
-    <Rule Id="CA1814" Action="Warning" />
-    <Rule Id="CA1815" Action="Warning" />
-    <Rule Id="CA1816" Action="Warning" />
-    <Rule Id="CA1819" Action="Warning" />
-    <Rule Id="CA1820" Action="Warning" />
-    <Rule Id="CA1821" Action="Warning" />
-    <Rule Id="CA1822" Action="Warning" />
-    <Rule Id="CA1823" Action="Warning" />
-    <Rule Id="CA1824" Action="Warning" />
-    <Rule Id="CA1900" Action="Warning" />
-    <Rule Id="CA1901" Action="Warning" />
-    <Rule Id="CA1903" Action="Warning" />
-    <Rule Id="CA2001" Action="Warning" />
-    <Rule Id="CA2002" Action="Warning" />
-    <Rule Id="CA2003" Action="Warning" />
-    <Rule Id="CA2004" Action="Warning" />
-    <Rule Id="CA2006" Action="Warning" />
-    <Rule Id="CA2100" Action="Warning" />
-    <Rule Id="CA2101" Action="Warning" />
-    <Rule Id="CA2102" Action="Warning" />
-    <Rule Id="CA2103" Action="Warning" />
-    <Rule Id="CA2104" Action="Warning" />
-    <Rule Id="CA2105" Action="Warning" />
-    <Rule Id="CA2106" Action="Warning" />
-    <Rule Id="CA2107" Action="Warning" />
-    <Rule Id="CA2108" Action="Warning" />
-    <Rule Id="CA2109" Action="Warning" />
-    <Rule Id="CA2111" Action="Warning" />
-    <Rule Id="CA2112" Action="Warning" />
-    <Rule Id="CA2114" Action="Warning" />
-    <Rule Id="CA2115" Action="Warning" />
-    <Rule Id="CA2116" Action="Warning" />
-    <Rule Id="CA2117" Action="Warning" />
-    <Rule Id="CA2118" Action="Warning" />
-    <Rule Id="CA2119" Action="Warning" />
-    <Rule Id="CA2120" Action="Warning" />
-    <Rule Id="CA2121" Action="Warning" />
-    <Rule Id="CA2122" Action="Warning" />
-    <Rule Id="CA2123" Action="Warning" />
-    <Rule Id="CA2124" Action="Warning" />
-    <Rule Id="CA2126" Action="Warning" />
-    <Rule Id="CA2130" Action="Warning" />
-    <Rule Id="CA2131" Action="Warning" />
-    <Rule Id="CA2132" Action="Warning" />
-    <Rule Id="CA2133" Action="Warning" />
-    <Rule Id="CA2134" Action="Warning" />
-    <Rule Id="CA2135" Action="Warning" />
-    <Rule Id="CA2136" Action="Warning" />
-    <Rule Id="CA2137" Action="Warning" />
-    <Rule Id="CA2138" Action="Warning" />
-    <Rule Id="CA2139" Action="Warning" />
-    <Rule Id="CA2140" Action="Warning" />
-    <Rule Id="CA2141" Action="Warning" />
-    <Rule Id="CA2142" Action="Warning" />
-    <Rule Id="CA2143" Action="Warning" />
-    <Rule Id="CA2144" Action="Warning" />
-    <Rule Id="CA2145" Action="Warning" />
-    <Rule Id="CA2146" Action="Warning" />
-    <Rule Id="CA2147" Action="Warning" />
-    <Rule Id="CA2149" Action="Warning" />
-    <Rule Id="CA2201" Action="Warning" />
-    <Rule Id="CA2202" Action="Warning" />
-    <Rule Id="CA2204" Action="Warning" />
-    <Rule Id="CA2205" Action="Warning" />
-    <Rule Id="CA2207" Action="Warning" />
-    <Rule Id="CA2208" Action="Warning" />
-    <Rule Id="CA2210" Action="Warning" />
-    <Rule Id="CA2211" Action="Warning" />
-    <Rule Id="CA2212" Action="Warning" />
-    <Rule Id="CA2213" Action="Warning" />
-    <Rule Id="CA2214" Action="Warning" />
-    <Rule Id="CA2215" Action="Warning" />
-    <Rule Id="CA2216" Action="Warning" />
-    <Rule Id="CA2217" Action="Warning" />
-    <Rule Id="CA2218" Action="Warning" />
-    <Rule Id="CA2219" Action="Warning" />
-    <Rule Id="CA2220" Action="Warning" />
-    <Rule Id="CA2221" Action="Warning" />
-    <Rule Id="CA2222" Action="Warning" />
-    <Rule Id="CA2223" Action="Warning" />
-    <Rule Id="CA2224" Action="Warning" />
-    <Rule Id="CA2225" Action="Warning" />
-    <Rule Id="CA2226" Action="Warning" />
-    <Rule Id="CA2227" Action="Warning" />
-    <Rule Id="CA2228" Action="Warning" />
-    <Rule Id="CA2229" Action="Warning" />
-    <Rule Id="CA2230" Action="Warning" />
-    <Rule Id="CA2231" Action="Warning" />
-    <Rule Id="CA2232" Action="Warning" />
-    <Rule Id="CA2233" Action="Warning" />
-    <Rule Id="CA2234" Action="Warning" />
-    <Rule Id="CA2235" Action="Warning" />
-    <Rule Id="CA2236" Action="Warning" />
-    <Rule Id="CA2237" Action="Warning" />
-    <Rule Id="CA2238" Action="Warning" />
-    <Rule Id="CA2239" Action="Warning" />
-    <Rule Id="CA2240" Action="Warning" />
-    <Rule Id="CA2241" Action="Warning" />
-    <Rule Id="CA2242" Action="Warning" />
-    <Rule Id="CA2243" Action="Warning" />
-  </Rules>
-</RuleSet>

+ 10 - 2
Rx.NET/Source/System.Reactive.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.28407.52
+# Visual Studio Version 17
+VisualStudioVersion = 17.5.33627.172
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive", "src\System.Reactive\System.Reactive.csproj", "{01706A0F-8A63-4FD6-AF45-0BC0BED3C0D9}"
 EndProject
@@ -15,6 +15,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.System.Reactive.Uwp.D
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{870348D0-C0A0-4352-8A02-E00AB0CCB919}"
 	ProjectSection(SolutionItems) = preProject
+		..\..\.editorconfig = ..\..\.editorconfig
+		src\.editorconfig = src\.editorconfig
+		analyzers.globalconfig = analyzers.globalconfig
 		..\..\azure-pipelines.rx.yml = ..\..\azure-pipelines.rx.yml
 		Directory.build.props = Directory.build.props
 		Directory.build.targets = Directory.build.targets
@@ -25,6 +28,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D324579D-CBE6-4867-8980-D7842C7C45A2}"
+	ProjectSection(SolutionItems) = preProject
+		tests\.editorconfig = tests\.editorconfig
+		tests\Directory.build.props = tests\Directory.build.props
+		tests\Directory.build.targets = tests\Directory.build.targets
+	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Facades", "Facades", "{A0F39260-B8F8-4FCB-9679-0ED917A22BDF}"
 	ProjectSection(SolutionItems) = preProject

+ 230 - 0
Rx.NET/Source/analyzers.globalconfig

@@ -0,0 +1,230 @@
+is_global = true
+
+# In .NET SDK 7, these are off by default in .NET Standard but on for everything else
+dotnet_diagnostic.CS0659.severity = warning
+dotnet_diagnostic.CS0661.severity = warning
+# This is off by default in .NET FX but on for everything else
+dotnet_diagnostic.CS1718.severity = warning
+
+dotnet_diagnostic.CA1000.severity = warning
+dotnet_diagnostic.CA1002.severity = warning
+dotnet_diagnostic.CA1003.severity = warning
+dotnet_diagnostic.CA1004.severity = warning
+dotnet_diagnostic.CA1007.severity = warning
+dotnet_diagnostic.CA1008.severity = warning
+dotnet_diagnostic.CA1009.severity = warning
+dotnet_diagnostic.CA1010.severity = warning
+dotnet_diagnostic.CA1012.severity = warning
+dotnet_diagnostic.CA1013.severity = warning
+dotnet_diagnostic.CA1016.severity = warning
+dotnet_diagnostic.CA1017.severity = warning
+dotnet_diagnostic.CA1018.severity = warning
+dotnet_diagnostic.CA1019.severity = warning
+dotnet_diagnostic.CA1020.severity = warning
+dotnet_diagnostic.CA1021.severity = warning
+dotnet_diagnostic.CA1023.severity = warning
+dotnet_diagnostic.CA1024.severity = warning
+dotnet_diagnostic.CA1025.severity = warning
+dotnet_diagnostic.CA1026.severity = warning
+dotnet_diagnostic.CA1027.severity = warning
+dotnet_diagnostic.CA1028.severity = warning
+dotnet_diagnostic.CA1030.severity = warning
+dotnet_diagnostic.CA1032.severity = warning
+dotnet_diagnostic.CA1033.severity = warning
+dotnet_diagnostic.CA1034.severity = warning
+dotnet_diagnostic.CA1035.severity = warning
+dotnet_diagnostic.CA1036.severity = warning
+dotnet_diagnostic.CA1038.severity = warning
+dotnet_diagnostic.CA1039.severity = warning
+dotnet_diagnostic.CA1040.severity = warning
+dotnet_diagnostic.CA1041.severity = warning
+dotnet_diagnostic.CA1043.severity = warning
+dotnet_diagnostic.CA1044.severity = warning
+dotnet_diagnostic.CA1045.severity = warning
+dotnet_diagnostic.CA1046.severity = warning
+dotnet_diagnostic.CA1047.severity = warning
+dotnet_diagnostic.CA1048.severity = warning
+dotnet_diagnostic.CA1049.severity = warning
+dotnet_diagnostic.CA1050.severity = warning
+dotnet_diagnostic.CA1051.severity = warning
+dotnet_diagnostic.CA1052.severity = warning
+dotnet_diagnostic.CA1053.severity = warning
+dotnet_diagnostic.CA1054.severity = warning
+dotnet_diagnostic.CA1055.severity = warning
+dotnet_diagnostic.CA1056.severity = warning
+dotnet_diagnostic.CA1057.severity = warning
+dotnet_diagnostic.CA1058.severity = warning
+dotnet_diagnostic.CA1059.severity = warning
+dotnet_diagnostic.CA1060.severity = warning
+dotnet_diagnostic.CA1061.severity = warning
+dotnet_diagnostic.CA1062.severity = warning
+dotnet_diagnostic.CA1063.severity = warning
+dotnet_diagnostic.CA1064.severity = warning
+dotnet_diagnostic.CA1065.severity = warning
+
+
+dotnet_diagnostic.CA1300.severity = warning
+dotnet_diagnostic.CA1301.severity = warning
+dotnet_diagnostic.CA1302.severity = warning
+dotnet_diagnostic.CA1303.severity = warning
+dotnet_diagnostic.CA1304.severity = warning
+dotnet_diagnostic.CA1305.severity = warning
+dotnet_diagnostic.CA1306.severity = warning
+dotnet_diagnostic.CA1307.severity = warning
+dotnet_diagnostic.CA1308.severity = warning
+dotnet_diagnostic.CA1309.severity = warning
+
+dotnet_diagnostic.CA1400.severity = warning
+dotnet_diagnostic.CA1401.severity = warning
+dotnet_diagnostic.CA1402.severity = warning
+dotnet_diagnostic.CA1403.severity = warning
+dotnet_diagnostic.CA1404.severity = warning
+dotnet_diagnostic.CA1405.severity = warning
+dotnet_diagnostic.CA1406.severity = warning
+dotnet_diagnostic.CA1407.severity = warning
+dotnet_diagnostic.CA1408.severity = warning
+dotnet_diagnostic.CA1409.severity = warning
+dotnet_diagnostic.CA1410.severity = warning
+dotnet_diagnostic.CA1411.severity = warning
+dotnet_diagnostic.CA1412.severity = warning
+dotnet_diagnostic.CA1413.severity = warning
+dotnet_diagnostic.CA1414.severity = warning
+dotnet_diagnostic.CA1415.severity = warning
+
+dotnet_diagnostic.CA1600.severity = warning
+dotnet_diagnostic.CA1601.severity = warning
+dotnet_diagnostic.CA1700.severity = warning
+dotnet_diagnostic.CA1701.severity = warning
+dotnet_diagnostic.CA1702.severity = warning
+dotnet_diagnostic.CA1703.severity = warning
+dotnet_diagnostic.CA1704.severity = warning
+dotnet_diagnostic.CA1707.severity = warning
+dotnet_diagnostic.CA1708.severity = warning
+dotnet_diagnostic.CA1709.severity = warning
+dotnet_diagnostic.CA1710.severity = warning
+dotnet_diagnostic.CA1711.severity = warning
+dotnet_diagnostic.CA1712.severity = warning
+dotnet_diagnostic.CA1713.severity = warning
+dotnet_diagnostic.CA1714.severity = warning
+dotnet_diagnostic.CA1715.severity = warning
+dotnet_diagnostic.CA1716.severity = warning
+dotnet_diagnostic.CA1717.severity = warning
+dotnet_diagnostic.CA1719.severity = warning
+dotnet_diagnostic.CA1720.severity = warning
+dotnet_diagnostic.CA1721.severity = warning
+dotnet_diagnostic.CA1722.severity = warning
+dotnet_diagnostic.CA1724.severity = warning
+dotnet_diagnostic.CA1725.severity = warning
+dotnet_diagnostic.CA1726.severity = warning
+
+dotnet_diagnostic.CA1800.severity = warning
+dotnet_diagnostic.CA1802.severity = warning
+dotnet_diagnostic.CA1804.severity = warning
+dotnet_diagnostic.CA1806.severity = warning
+dotnet_diagnostic.CA1809.severity = warning
+dotnet_diagnostic.CA1810.severity = warning
+dotnet_diagnostic.CA1811.severity = warning
+dotnet_diagnostic.CA1812.severity = warning
+dotnet_diagnostic.CA1813.severity = warning
+dotnet_diagnostic.CA1814.severity = warning
+dotnet_diagnostic.CA1815.severity = warning
+dotnet_diagnostic.CA1816.severity = warning
+dotnet_diagnostic.CA1819.severity = warning
+dotnet_diagnostic.CA1820.severity = warning
+dotnet_diagnostic.CA1821.severity = warning
+dotnet_diagnostic.CA1822.severity = warning
+dotnet_diagnostic.CA1823.severity = warning
+dotnet_diagnostic.CA1824.severity = warning
+
+dotnet_diagnostic.CA1900.severity = warning
+dotnet_diagnostic.CA1901.severity = warning
+dotnet_diagnostic.CA1903.severity = warning
+
+dotnet_diagnostic.CA2001.severity = warning
+dotnet_diagnostic.CA2002.severity = warning
+dotnet_diagnostic.CA2003.severity = warning
+dotnet_diagnostic.CA2004.severity = warning
+dotnet_diagnostic.CA2006.severity = warning
+dotnet_diagnostic.CA2100.severity = warning
+dotnet_diagnostic.CA2101.severity = warning
+dotnet_diagnostic.CA2102.severity = warning
+dotnet_diagnostic.CA2103.severity = warning
+dotnet_diagnostic.CA2104.severity = warning
+dotnet_diagnostic.CA2105.severity = warning
+dotnet_diagnostic.CA2106.severity = warning
+dotnet_diagnostic.CA2107.severity = warning
+dotnet_diagnostic.CA2108.severity = warning
+dotnet_diagnostic.CA2109.severity = warning
+dotnet_diagnostic.CA2111.severity = warning
+dotnet_diagnostic.CA2112.severity = warning
+dotnet_diagnostic.CA2114.severity = warning
+dotnet_diagnostic.CA2115.severity = warning
+dotnet_diagnostic.CA2116.severity = warning
+dotnet_diagnostic.CA2117.severity = warning
+dotnet_diagnostic.CA2118.severity = warning
+dotnet_diagnostic.CA2119.severity = warning
+dotnet_diagnostic.CA2120.severity = warning
+dotnet_diagnostic.CA2121.severity = warning
+dotnet_diagnostic.CA2122.severity = warning
+dotnet_diagnostic.CA2123.severity = warning
+dotnet_diagnostic.CA2124.severity = warning
+dotnet_diagnostic.CA2126.severity = warning
+dotnet_diagnostic.CA2130.severity = warning
+dotnet_diagnostic.CA2131.severity = warning
+dotnet_diagnostic.CA2132.severity = warning
+dotnet_diagnostic.CA2133.severity = warning
+dotnet_diagnostic.CA2134.severity = warning
+dotnet_diagnostic.CA2135.severity = warning
+dotnet_diagnostic.CA2136.severity = warning
+dotnet_diagnostic.CA2137.severity = warning
+dotnet_diagnostic.CA2138.severity = warning
+dotnet_diagnostic.CA2139.severity = warning
+dotnet_diagnostic.CA2140.severity = warning
+dotnet_diagnostic.CA2141.severity = warning
+dotnet_diagnostic.CA2142.severity = warning
+dotnet_diagnostic.CA2143.severity = warning
+dotnet_diagnostic.CA2144.severity = warning
+dotnet_diagnostic.CA2145.severity = warning
+dotnet_diagnostic.CA2146.severity = warning
+dotnet_diagnostic.CA2147.severity = warning
+dotnet_diagnostic.CA2149.severity = warning
+
+dotnet_diagnostic.CA2201.severity = warning
+dotnet_diagnostic.CA2202.severity = warning
+dotnet_diagnostic.CA2204.severity = warning
+dotnet_diagnostic.CA2205.severity = warning
+dotnet_diagnostic.CA2207.severity = warning
+dotnet_diagnostic.CA2208.severity = warning
+dotnet_diagnostic.CA2210.severity = warning
+dotnet_diagnostic.CA2211.severity = warning
+dotnet_diagnostic.CA2212.severity = warning
+dotnet_diagnostic.CA2213.severity = warning
+dotnet_diagnostic.CA2214.severity = warning
+dotnet_diagnostic.CA2215.severity = warning
+dotnet_diagnostic.CA2216.severity = warning
+dotnet_diagnostic.CA2217.severity = warning
+dotnet_diagnostic.CA2219.severity = warning
+dotnet_diagnostic.CA2220.severity = warning
+dotnet_diagnostic.CA2221.severity = warning
+dotnet_diagnostic.CA2222.severity = warning
+dotnet_diagnostic.CA2223.severity = warning
+dotnet_diagnostic.CA2224.severity = warning
+dotnet_diagnostic.CA2225.severity = warning
+dotnet_diagnostic.CA2226.severity = warning
+dotnet_diagnostic.CA2227.severity = warning
+dotnet_diagnostic.CA2228.severity = warning
+dotnet_diagnostic.CA2229.severity = warning
+dotnet_diagnostic.CA2230.severity = warning
+dotnet_diagnostic.CA2231.severity = warning
+dotnet_diagnostic.CA2232.severity = warning
+dotnet_diagnostic.CA2233.severity = warning
+dotnet_diagnostic.CA2234.severity = warning
+dotnet_diagnostic.CA2235.severity = warning
+dotnet_diagnostic.CA2236.severity = warning
+dotnet_diagnostic.CA2237.severity = warning
+dotnet_diagnostic.CA2238.severity = warning
+dotnet_diagnostic.CA2239.severity = warning
+dotnet_diagnostic.CA2240.severity = warning
+dotnet_diagnostic.CA2241.severity = warning
+dotnet_diagnostic.CA2242.severity = warning
+dotnet_diagnostic.CA2243.severity = warning

+ 16 - 0
Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/Benchmarks.System.Reactive.csproj

@@ -8,6 +8,22 @@
     <Configurations>Current Sources;Rx.net 3.1.1;Rx.net 4.0</Configurations>
   </PropertyGroup>
 
+  <!--
+    Test projects are not designed for public consumption so the analysis rules mostly produce
+    false positives.
+    -->
+
+  <PropertyGroup>
+    <AnalysisLevelNaming>7.0-none</AnalysisLevelNaming>
+    <AnalysisLevelPerformance>7.0-none</AnalysisLevelPerformance>
+    <NoWarn>$(NoWarn);IDE1006</NoWarn>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <GlobalAnalyzerConfigFiles Remove="$(MSBuildThisFileDirectory)..\..\analyzers.globalconfig" />
+  </ItemGroup>
+
+
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rx.net 3.1.1|AnyCPU'">
     <DefineConstants>$(DefineConstants);RX3_1_1</DefineConstants>
   </PropertyGroup>

+ 2 - 2
Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/CombineLatestBenchmark.cs

@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information.
 
@@ -10,7 +10,7 @@ namespace Benchmarks.System.Reactive
     [MemoryDiagnoser]
     public class CombineLatestBenchmark
     {
-        private CombineLatestTest _zipTest = new CombineLatestTest();
+        private readonly CombineLatestTest _zipTest = new();
 
         [Benchmark]
         public void CombineLatest_Typical2()

+ 2 - 2
Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/ComparisonAsyncBenchmark.cs

@@ -18,8 +18,8 @@ namespace Benchmarks.System.Reactive
         public int N;
         private int _store;
 
-        IScheduler _scheduler1;
-        IScheduler _scheduler2;
+        private IScheduler _scheduler1;
+        private IScheduler _scheduler2;
 
         [GlobalSetup]
         public void Setup()

+ 1 - 1
Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/ComparisonBenchmark.cs

@@ -25,7 +25,7 @@ namespace Benchmarks.System.Reactive
         public void ForLoopBaseLine()
         {
             var n = N;
-            for (var i = 0; i < N; i++)
+            for (var i = 0; i < n; i++)
             {
                 Volatile.Write(ref _store, i);
             }

+ 4 - 2
Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/PrependVsStartWtihBenchmark.cs

@@ -15,7 +15,9 @@ namespace Benchmarks.System.Reactive
     public class PrependVsStartWtihBenchmark
     {
         private int _store;
+#pragma warning disable IDE0052 // (Remove unread private members.) We want to store results to prevent the benchmarked code from being optimized out of existence.
         private IObservable<int> _obsStore;
+#pragma warning restore IDE0052
 
         [Benchmark(Baseline = true)]
         public void Prepend()
@@ -35,7 +37,7 @@ namespace Benchmarks.System.Reactive
         }
 
 
-        static readonly IObservable<int> _prependObservable = Observable.Empty<int>().Prepend(0);
+        private static readonly IObservable<int> _prependObservable = Observable.Empty<int>().Prepend(0);
         [Benchmark]
         public void Prepend_Subscribe()
         {
@@ -60,7 +62,7 @@ namespace Benchmarks.System.Reactive
                 .StartWith(0);
         }
 
-        static readonly IObservable<int> _startWithObservable = Observable.Empty<int>().StartWith(0);
+        private static readonly IObservable<int> _startWithObservable = Observable.Empty<int>().StartWith(0);
         [Benchmark]
         public void StartWith_Subscribe()
         {

+ 2 - 2
Rx.NET/Source/benchmarks/Benchmarks.System.Reactive/ZipBenchmark.cs

@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information.
 
@@ -10,7 +10,7 @@ namespace Benchmarks.System.Reactive
     [MemoryDiagnoser]
     public class ZipBenchmark
     {
-        private ZipTest _zipTest = new ZipTest();
+        private readonly ZipTest _zipTest = new();
 
         [Benchmark]
         public void Zip_NAry_Asymmetric()

+ 70 - 0
Rx.NET/Source/src/.editorconfig

@@ -0,0 +1,70 @@
+[*.cs]
+# Suppress spurious 'unnecessary suppression' reports.
+#
+# A load of these come from CA1704. We currently can't use this, but want to reinstate it at some
+# point, so we don't want to delete all of the suppression attributes that used to suppress the
+# spurious reports the old StyleCop-era CA1704 analyzer produced. We expect to need most of those
+# attributes if we manage to re-instate CA1704. But since CA1704 is currently not enabled, these
+# suppression attributes would produce an IDE0079 (Remove unnecessary suppression) message. We
+# disable IDE0079 for CA1704 so that we can leave these suppressions in place, ready for when
+# CA1704 might be restored.
+# So why aren't we using CA1704? The CA1704 current analyzer is essentially broken. Microsoft
+# never ported this analyzer into the new world of Roslyn-based code analyzers. This is not
+# obvious because the source for a new CA1704 analyzer does in fact exist, and it's in the same
+# repo as all the supported ones. However, it's deemed to be an unsupported community effort,
+# it lives in its own NuGet package (with the surprisingly generic name of Text.Analyzers).
+# It has two serious flaws:
+#   https://github.com/dotnet/roslyn-analyzers/issues/6024 - it can't be configured to ignore
+#       private symbols
+#   https://github.com/dotnet/roslyn-analyzers/issues/5183 - its definition of 'unmeaningful' is
+#       too broad, and can't be disabled
+# The first issue could perhaps be circumvented by adding a few entries to a custom dictionary, but
+# the second is impossible to work around.  The analyzer describes type arguments of the form `T1`,
+# `T2` etc as 'meaningless' # and there's no way to stop that. This is a significant problem for Rx,
+# because we have quite a lot of methods with large numbers of generic type arguments in which the
+# meaning of those type arguments is entirely up to application code, so there's simply no way for
+# us to give them meaningful names. As with .NET runtime library types like Action<T1, T2, T3> we
+# just use names like T1, T2, T3. The names are deliberately meaningless, because they represent
+# placeholders for application types that will signify whatever the application wants to signify.
+# So there are no better names, and in any case it would technically be a breaking change to
+# rename them. We might be able to deal with this by adding enormous numbers of suppressions, but
+# it would be better for the CA1704 analyzer to be fixed - we aren't the only users for which this
+# is a major issue.
+# We also disable suppression warnings for CA1711. It's currently a mystery why that's being
+# reported as unnecessary on ObservableEx, but it is, so we've squelched it.
+# IL2060 is considered unnecessary on targets that don't support trimming, but we don't want to wrap every
+# single one in a conditional, so we also suppress warnings about unnecessary suppressions on those.
+dotnet_remove_unnecessary_suppression_exclusions = CA1704,CA1711,IL2060
+
+
+# Prevent IDE1006 (Naming rule violation) errors for non-public fields.
+#
+# Unfortunately, the codebase has not historically been entirely consistent with internal naming
+# conventions. Apparently this wasn't noticed by older analyzer tooling, but as of the .NET 7
+# era, the naming rules analyzers are a bit more particular, and cannot be configured in a way
+# that makes them happy with the code as it stands. We could rename all the relevant symbols,
+# but that doesn't seem like an especially good use of time, so for now, we're suppressing
+# diagnostics in certain cases.
+#
+# Static readonly fields
+dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.severity = none
+
+# Internal fields
+dotnet_naming_symbols.internal_field_symbols.applicable_kinds           = field
+dotnet_naming_symbols.internal_field_symbols.applicable_accessibilities = internal
+
+dotnet_naming_rule.internal_instance_fields_must_be_camel_cased_underscore_prefix.symbols  = internal_field_symbols
+dotnet_naming_rule.internal_instance_fields_must_be_camel_cased_underscore_prefix.style    = camel_case_and_prefix_with_underscore_style
+dotnet_naming_rule.internal_instance_fields_must_be_camel_cased_underscore_prefix.severity = none
+
+# Protected fields
+# Annoyingly, a protected field in an internal class cannot be distinguished from a protected field in a public
+# class. That's unfortunate, because the latter are publicly visible, but the former are not, so we don't really
+# want to enforce public naming conventions on them. We generally avoid publicly visible fields, so the majority
+# of protected fields are in fact in internal types, so we use naming conventions appropriate to those.
+dotnet_naming_symbols.protected_field_symbols.applicable_kinds           = field
+dotnet_naming_symbols.protected_field_symbols.applicable_accessibilities = protected
+
+dotnet_naming_rule.protected_instance_fields_must_be_camel_cased_underscore_prefix.symbols  = protected_field_symbols
+dotnet_naming_rule.protected_instance_fields_must_be_camel_cased_underscore_prefix.style    = camel_case_and_prefix_with_underscore_style
+dotnet_naming_rule.protected_instance_fields_must_be_camel_cased_underscore_prefix.severity = none

+ 1 - 1
Rx.NET/Source/src/Microsoft.Reactive.Testing/ColdObservable.cs

@@ -13,7 +13,7 @@ namespace Microsoft.Reactive.Testing
     {
         private readonly TestScheduler _scheduler;
         private readonly Recorded<Notification<T>>[] _messages;
-        private readonly List<Subscription> _subscriptions = new List<Subscription>();
+        private readonly List<Subscription> _subscriptions = new();
 
         public ColdObservable(TestScheduler scheduler, params Recorded<Notification<T>>[] messages)
         {

+ 3 - 3
Rx.NET/Source/src/Microsoft.Reactive.Testing/GlobalSuppressions.cs

@@ -13,8 +13,8 @@
 // You do not need to add suppressions to this file manually.
 
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1053:StaticHolderTypesShouldNotHaveConstructors", Scope = "type", Target = "Microsoft.Reactive.Testing.ReactiveTest")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1053:StaticHolderTypesShouldNotHaveConstructors", Scope = "type", Target = "~T:Microsoft.Reactive.Testing.ReactiveTest")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1014:MarkAssembliesWithClsCompliant")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "Microsoft.Reactive.Testing.ReactiveAssert.#Throws`1(System.Action,System.String)")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "Microsoft.Reactive.Testing.ReactiveAssert.#Throws`1(System.Action)")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "~M:Microsoft.Reactive.Testing.ReactiveAssert.Throws``1(System.Action,System.String)")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "~M:Microsoft.Reactive.Testing.ReactiveAssert.Throws``1(System.Action)")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1016:MarkAssembliesWithAssemblyVersion")]

+ 2 - 2
Rx.NET/Source/src/Microsoft.Reactive.Testing/HotObservable.cs

@@ -12,8 +12,8 @@ namespace Microsoft.Reactive.Testing
     internal class HotObservable<T> : ITestableObservable<T>
     {
         private readonly TestScheduler _scheduler;
-        private readonly List<IObserver<T>> _observers = new List<IObserver<T>>();
-        private readonly List<Subscription> _subscriptions = new List<Subscription>();
+        private readonly List<IObserver<T>> _observers = new();
+        private readonly List<Subscription> _subscriptions = new();
         private readonly Recorded<Notification<T>>[] _messages;
 
         public HotObservable(TestScheduler scheduler, params Recorded<Notification<T>>[] messages)

+ 6 - 2
Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj

@@ -7,8 +7,12 @@
     <DefineConstants>$(DefineConstants);PLATFORM_DOTNET;XUNIT_VISIBILITY_INTERNAL</DefineConstants>        
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>    
     <Description>Reactive Extensions (Rx) for .NET - Testing Library</Description>
-    <!-- NB: A lot of CA warnings are disabled because of the .cs files included from xunit.assert.source. -->
-    <NoWarn>$(NoWarn);IDE0054;IDE0066;CA1305;CA1307;CA1032;CA1064;CA1822;CA1812;CA1820;CA1823</NoWarn>
+    <!-- NB: A lot of CA and IDE warnings are disabled because of the .cs files included from xunit.assert.source. -->
+    <NoWarn>$(NoWarn);IDE0054;IDE0066;CA1305;CA1307;CA1032;CA1064;CA1704;CA1822;CA1812;CA1820;CA1823;CA1825;CA1845;CA2249;IDE0016;IDE0018;IDE0019;IDE0020;IDE0031;IDE0039;IDE0044;IDE0059;IDE0074;IDE0270</NoWarn>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <AnalysisLevelPerformance>7.0-None</AnalysisLevelPerformance>
   </PropertyGroup>
 
   <ItemGroup>

+ 3 - 3
Rx.NET/Source/src/Microsoft.Reactive.Testing/MockObserver.cs

@@ -10,12 +10,12 @@ namespace Microsoft.Reactive.Testing
 {
     internal class MockObserver<T> : ITestableObserver<T>
     {
-        private TestScheduler _scheduler;
-        private List<Recorded<Notification<T>>> _messages;
+        private readonly TestScheduler _scheduler;
+        private readonly List<Recorded<Notification<T>>> _messages;
 
         public MockObserver(TestScheduler scheduler)
         {
-            this._scheduler = scheduler ?? throw new ArgumentNullException(nameof(scheduler));
+            _scheduler = scheduler ?? throw new ArgumentNullException(nameof(scheduler));
             _messages = new List<Recorded<Notification<T>>>();
         }
 

+ 8 - 0
Rx.NET/Source/src/Microsoft.Reactive.Testing/ReactiveTest.cs

@@ -10,7 +10,9 @@ namespace Microsoft.Reactive.Testing
     /// <summary>
     /// Base class to write unit tests for applications and libraries built using Reactive Extensions.
     /// </summary>
+#pragma warning disable CA1052 // (Static holder types should be Static or NotInheritable). Tests inherit from this to bring static members into scope
     public class ReactiveTest
+#pragma warning restore CA1052
     {
         /// <summary>
         /// Default virtual time used for creation of observable sequences in <see cref="ReactiveTest"/>-based unit tests.
@@ -75,7 +77,9 @@ namespace Microsoft.Reactive.Testing
         /// <param name="ticks">Recorded virtual time the OnCompleted notification occurs.</param>
         /// <param name="witness">Object solely used to infer the type of the <typeparamref name="T"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>Recorded OnCompleted notification.</returns>
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required for type inference
         public static Recorded<Notification<T>> OnCompleted<T>(long ticks, T witness)
+#pragma warning restore IDE0060
         {
             return new Recorded<Notification<T>>(ticks, Notification.CreateOnCompleted<T>());
         }
@@ -125,7 +129,9 @@ namespace Microsoft.Reactive.Testing
         /// <param name="witness">Object solely used to infer the type of the <typeparamref name="T"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>Recorded OnError notification.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="exception"/> is null.</exception>
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required for type inference
         public static Recorded<Notification<T>> OnError<T>(long ticks, Exception exception, T witness)
+#pragma warning restore IDE0060
         {
             if (exception == null)
             {
@@ -144,7 +150,9 @@ namespace Microsoft.Reactive.Testing
         /// <param name="witness">Object solely used to infer the type of the <typeparamref name="T"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>Recorded OnError notification with a predicate to assert a given exception.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="predicate"/> is null.</exception>
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required for type inference
         public static Recorded<Notification<T>> OnError<T>(long ticks, Func<Exception, bool> predicate, T witness)
+#pragma warning restore IDE0060
         {
             if (predicate == null)
             {

+ 1 - 1
Rx.NET/Source/src/Microsoft.Reactive.Testing/Recorded.cs

@@ -70,7 +70,7 @@ namespace Microsoft.Reactive.Testing
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="Recorded{T}"/> value.</param>
         /// <returns>true if the specified System.Object is equal to the current <see cref="Recorded{T}"/> value; otherwise, false.</returns>
-        public override bool Equals(object obj) => obj is Recorded<T> && Equals((Recorded<T>)obj);
+        public override bool Equals(object obj) => obj is Recorded<T> recorded && Equals(recorded);
 
         /// <summary>
         /// Returns the hash code for the current <see cref="Recorded{T}"/> value.

+ 1 - 1
Rx.NET/Source/src/Microsoft.Reactive.Testing/Subscription.cs

@@ -83,7 +83,7 @@ namespace Microsoft.Reactive.Testing
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current Subscription value.</param>
         /// <returns>true if the specified System.Object is equal to the current Subscription value; otherwise, false.</returns>
-        public override bool Equals(object obj) => obj is Subscription && Equals((Subscription)obj);
+        public override bool Equals(object obj) => obj is Subscription subscription && Equals(subscription);
 
         /// <summary>
         /// Returns the hash code for the current Subscription value.

+ 1 - 5
Rx.NET/Source/src/System.Reactive.Observable.Aliases/Observable.Aliases.cs

@@ -1,9 +1,7 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#pragma warning disable 1591
-
 using System.Collections.Generic;
 using System.Reactive.Linq;
 using System.Reactive.Threading.Tasks; // needed for doc comments
@@ -411,5 +409,3 @@ namespace System.Reactive.Observable.Aliases
     }
 
 }
-
-#pragma warning restore 1591

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/AsyncLock.cs

@@ -13,7 +13,7 @@ namespace System.Reactive.Concurrency
     {
         private bool _isAcquired;
         private bool _hasFaulted;
-        private readonly object _guard = new object();
+        private readonly object _guard = new();
         private Queue<(Action<Delegate, object?> action, Delegate @delegate, object? state)>? _queue;
 
         /// <summary>

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayer.cs

@@ -19,14 +19,12 @@ namespace System.Reactive.Concurrency
 
         private static IConcurrencyAbstractionLayer Initialize()
         {
-#pragma warning disable CS0618 // Type or member is obsolete
             //
             // NB: For compat reasons, we allow null to leak here. Bad things will happen but we don't want
             //     to trigger an exception earlier than we did before. The only case where this can happen
             //     is when a custom PEP is installed, which is very rare (e.g. debugger, service hosting).
             //
             return PlatformEnlightenmentProvider.Current.GetService<IConcurrencyAbstractionLayer>()!;
-#pragma warning restore CS0618 // Type or member is obsolete
         }
     }
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs

@@ -155,7 +155,7 @@ namespace System.Reactive.Concurrency
             private Action<object?> _action;
             private SingleAssignmentDisposableValue _timer;
 
-            private static readonly object DisposedState = new object();
+            private static readonly object DisposedState = new();
 
             public Timer(Action<object?> action, object? state, TimeSpan dueTime)
             {

+ 2 - 6
Rx.NET/Source/src/System.Reactive/Concurrency/CurrentThreadScheduler.cs

@@ -12,7 +12,7 @@ namespace System.Reactive.Concurrency
     /// <seealso cref="Scheduler.CurrentThread">Singleton instance of this type exposed through this static property.</seealso>
     public sealed class CurrentThreadScheduler : LocalScheduler
     {
-        private static readonly Lazy<CurrentThreadScheduler> StaticInstance = new Lazy<CurrentThreadScheduler>(() => new CurrentThreadScheduler());
+        private static readonly Lazy<CurrentThreadScheduler> StaticInstance = new(() => new CurrentThreadScheduler());
 
         private CurrentThreadScheduler()
         {
@@ -43,10 +43,7 @@ namespace System.Reactive.Concurrency
         {
             get
             {
-                if (_clock == null)
-                {
-                    _clock = ConcurrencyAbstractionLayer.Current.StartStopwatch();
-                }
+                _clock ??= ConcurrencyAbstractionLayer.Current.StartStopwatch();
 
                 return _clock.Elapsed;
             }
@@ -55,7 +52,6 @@ namespace System.Reactive.Concurrency
         /// <summary>
         /// Gets a value that indicates whether the caller must call a Schedule method.
         /// </summary>
-        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Now marked as obsolete.")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         [Obsolete(Constants_Core.ObsoleteSchedulerequired)] // Preferring static method call over instance method call.
         public bool ScheduleRequired => IsScheduleRequired;

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/DefaultScheduler.cs

@@ -12,7 +12,7 @@ namespace System.Reactive.Concurrency
     /// <seealso cref="Scheduler.Default">Singleton instance of this type exposed through this static property.</seealso>
     public sealed class DefaultScheduler : LocalScheduler, ISchedulerPeriodic
     {
-        private static readonly Lazy<DefaultScheduler> DefaultInstance = new Lazy<DefaultScheduler>(() => new DefaultScheduler());
+        private static readonly Lazy<DefaultScheduler> DefaultInstance = new(() => new DefaultScheduler());
         private static readonly IConcurrencyAbstractionLayer Cal = ConcurrencyAbstractionLayer.Current;
 
         /// <summary>
@@ -110,7 +110,7 @@ namespace System.Reactive.Concurrency
             private TState _state;
             private Func<TState, TState> _action;
             private readonly IDisposable _cancel;
-            private readonly AsyncLock _gate = new AsyncLock();
+            private readonly AsyncLock _gate = new();
 
             public PeriodicallyScheduledWorkItem(TState state, TimeSpan period, Func<TState, TState> action)
             {

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs

@@ -199,7 +199,7 @@ namespace System.Reactive.Concurrency
             private readonly TimeSpan _period;
             private readonly Func<TState, TState> _action;
             private readonly EventLoopScheduler _scheduler;
-            private readonly AsyncLock _gate = new AsyncLock();
+            private readonly AsyncLock _gate = new();
 
             private TState _state;
             private TimeSpan _next;

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/HistoricalScheduler.cs

@@ -74,7 +74,7 @@ namespace System.Reactive.Concurrency
     "\\}")]
     public class HistoricalScheduler : HistoricalSchedulerBase
     {
-        private readonly SchedulerQueue<DateTimeOffset> _queue = new SchedulerQueue<DateTimeOffset>();
+        private readonly SchedulerQueue<DateTimeOffset> _queue = new();
 
         /// <summary>
         /// Creates a new historical scheduler with the minimum value of <see cref="DateTimeOffset"/> as the initial clock value.

+ 3 - 9
Rx.NET/Source/src/System.Reactive/Concurrency/ImmediateScheduler.cs

@@ -12,7 +12,7 @@ namespace System.Reactive.Concurrency
     /// <seealso cref="Scheduler.Immediate">Singleton instance of this type exposed through this static property.</seealso>
     public sealed class ImmediateScheduler : LocalScheduler
     {
-        private static readonly Lazy<ImmediateScheduler> StaticInstance = new Lazy<ImmediateScheduler>(static () => new ImmediateScheduler());
+        private static readonly Lazy<ImmediateScheduler> StaticInstance = new(static () => new ImmediateScheduler());
 
         private ImmediateScheduler()
         {
@@ -79,10 +79,7 @@ namespace System.Reactive.Concurrency
 
                 var m = new SingleAssignmentDisposable();
 
-                if (_asyncLock == null)
-                {
-                    _asyncLock = new AsyncLock();
-                }
+                _asyncLock ??= new AsyncLock();
 
                 _asyncLock.Wait(
                     (@this: this, m, action, state),
@@ -118,10 +115,7 @@ namespace System.Reactive.Concurrency
 
                 var m = new SingleAssignmentDisposable();
 
-                if (_asyncLock == null)
-                {
-                    _asyncLock = new AsyncLock();
-                }
+                _asyncLock ??= new AsyncLock();
 
                 _asyncLock.Wait(
                     (@this: this, m, state, action, timer, dueTime),

+ 6 - 7
Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.TimerQueue.cs

@@ -14,26 +14,26 @@ namespace System.Reactive.Concurrency
         /// <summary>
         /// Gate to protect local scheduler queues.
         /// </summary>
-        private static readonly object Gate = new object();
+        private static readonly object Gate = new();
 
         /// <summary>
         /// Gate to protect queues and to synchronize scheduling decisions and system clock
         /// change management.
         /// </summary>
-        private static readonly object StaticGate = new object();
+        private static readonly object StaticGate = new();
 
         /// <summary>
         /// Long term work queue. Contains work that's due beyond SHORTTERM, computed at the
         /// time of enqueueing.
         /// </summary>
-        private static readonly PriorityQueue<WorkItem/*!*/> LongTerm = new PriorityQueue<WorkItem/*!*/>();
+        private static readonly PriorityQueue<WorkItem/*!*/> LongTerm = new();
 
         /// <summary>
         /// Disposable resource for the long term timer that will reevaluate and dispatch the
         /// first item in the long term queue. A serial disposable is used to make "dispose
         /// current and assign new" logic easier. The disposable itself is never disposed.
         /// </summary>
-        private static readonly SerialDisposable NextLongTermTimer = new SerialDisposable();
+        private static readonly SerialDisposable NextLongTermTimer = new();
 
         /// <summary>
         /// Item at the head of the long term queue for which the current long term timer is
@@ -49,13 +49,13 @@ namespace System.Reactive.Concurrency
         /// items. This queue is kept in order to be able to relocate short term items back
         /// to the long term queue in case a system clock change occurs.
         /// </summary>
-        private readonly PriorityQueue<WorkItem/*!*/> _shortTerm = new PriorityQueue<WorkItem/*!*/>();
+        private readonly PriorityQueue<WorkItem/*!*/> _shortTerm = new();
 
         /// <summary>
         /// Set of disposable handles to all of the current short term work Schedule calls,
         /// allowing those to be cancelled upon a system clock change.
         /// </summary>
-        private readonly HashSet<IDisposable> _shortTermWork = new HashSet<IDisposable>();
+        private readonly HashSet<IDisposable> _shortTermWork = new();
 
         /// <summary>
         /// Threshold where an item is considered to be short term work or gets moved from
@@ -104,7 +104,6 @@ namespace System.Reactive.Concurrency
         /// <summary>
         /// Creates a new local scheduler.
         /// </summary>
-        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline", Justification = "We can't really lift this into a field initializer, and would end up checking for an initialization flag in every static method anyway (which is roughly what the JIT does in a thread-safe manner).")]
         protected LocalScheduler()
         {
             //

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/NewThreadScheduler.cs

@@ -12,7 +12,7 @@ namespace System.Reactive.Concurrency
     /// </summary>
     public sealed class NewThreadScheduler : LocalScheduler, ISchedulerLongRunning, ISchedulerPeriodic
     {
-        private static readonly Lazy<NewThreadScheduler> Instance = new Lazy<NewThreadScheduler>(static () => new NewThreadScheduler());
+        private static readonly Lazy<NewThreadScheduler> Instance = new(static () => new NewThreadScheduler());
 
         private readonly Func<ThreadStart, Thread> _threadFactory;
 
@@ -130,7 +130,7 @@ namespace System.Reactive.Concurrency
             private readonly TimeSpan _period;
             private readonly Func<TState, TState> _action;
 
-            private readonly object _cancel = new object();
+            private readonly object _cancel = new();
             private volatile bool _done;
 
             private TState _state;

+ 2 - 0
Rx.NET/Source/src/System.Reactive/Concurrency/ScheduledItem.cs

@@ -11,6 +11,7 @@ namespace System.Reactive.Concurrency
     /// Abstract base class for scheduled work items.
     /// </summary>
     /// <typeparam name="TAbsolute">Absolute time representation type.</typeparam>
+#pragma warning disable CA1033, CA1063, CA1816 // (Overridable IDisposable.) This is a specialized base type, and it would be inappropriate to encourage anyone to build derived types that do more in Dispose.
     public abstract class ScheduledItem<TAbsolute> : IScheduledItem<TAbsolute>, IComparable<ScheduledItem<TAbsolute>>, IDisposable
         where TAbsolute : IComparable<TAbsolute>
     {
@@ -155,6 +156,7 @@ namespace System.Reactive.Concurrency
 
         void IDisposable.Dispose() => Cancel();
     }
+#pragma warning restore CA1033, CA1063, CA1816
 
     /// <summary>
     /// Represents a scheduled work item based on the materialization of an IScheduler.Schedule method call.

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Async.cs

@@ -12,7 +12,7 @@ namespace System.Reactive.Concurrency
     {
         private sealed class AsyncInvocation<TState> : IDisposable
         {
-            private readonly CancellationTokenSource _cts = new CancellationTokenSource();
+            private readonly CancellationTokenSource _cts = new();
             private SingleAssignmentDisposableValue _run;
 
             public IDisposable Run(IScheduler self, TState s, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.cs

@@ -335,8 +335,8 @@ namespace System.Reactive.Concurrency
 
             private TState _state;
 
-            private readonly object _gate = new object();
-            private readonly AutoResetEvent _resumeEvent = new AutoResetEvent(false);
+            private readonly object _gate = new();
+            private readonly AutoResetEvent _resumeEvent = new(false);
             private volatile int _runState;
             private IStopwatch? _stopwatch;
             private TimeSpan _nextDue;

+ 5 - 12
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.cs

@@ -60,7 +60,7 @@ namespace System.Reactive.Concurrency
         //
 
 
-        private static readonly Lazy<IScheduler> _threadPool = new Lazy<IScheduler>(static () => Initialize("ThreadPool"));
+        private static readonly Lazy<IScheduler> _threadPool = new(static () => Initialize("ThreadPool"));
 
         /// <summary>
         /// Gets a scheduler that schedules work on the thread pool.
@@ -68,7 +68,7 @@ namespace System.Reactive.Concurrency
         [Obsolete(Constants_Core.ObsoleteSchedulerThreadpool)]
         public static IScheduler ThreadPool => _threadPool.Value;
 
-        private static readonly Lazy<IScheduler> _newThread = new Lazy<IScheduler>(static () => Initialize("NewThread"));
+        private static readonly Lazy<IScheduler> _newThread = new(static () => Initialize("NewThread"));
 
         /// <summary>
         /// Gets a scheduler that schedules work on a new thread using default thread creation options.
@@ -76,7 +76,7 @@ namespace System.Reactive.Concurrency
         [Obsolete(Constants_Core.ObsoleteSchedulerNewthread)]
         public static IScheduler NewThread => _newThread.Value;
 
-        private static readonly Lazy<IScheduler> _taskPool = new Lazy<IScheduler>(static () => Initialize("TaskPool"));
+        private static readonly Lazy<IScheduler> _taskPool = new(static () => Initialize("TaskPool"));
 
         /// <summary>
         /// Gets a scheduler that schedules work on Task Parallel Library (TPL) task pool using the default TaskScheduler.
@@ -86,15 +86,8 @@ namespace System.Reactive.Concurrency
 
         private static IScheduler Initialize(string name)
         {
-#pragma warning disable CS0618 // Type or member is obsolete
-            var res = PlatformEnlightenmentProvider.Current.GetService<IScheduler>(name);
-#pragma warning restore CS0618 // Type or member is obsolete
-            if (res == null)
-            {
-                throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, Strings_Core.CANT_OBTAIN_SCHEDULER, name));
-            }
-
-            return res;
+            return PlatformEnlightenmentProvider.Current.GetService<IScheduler>(name)
+                ?? throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, Strings_Core.CANT_OBTAIN_SCHEDULER, name));
         }
     }
 }

+ 5 - 5
Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerOperation.cs

@@ -18,11 +18,11 @@ namespace System.Reactive.Concurrency
         private readonly bool _postBackToOriginalContext;
 
         internal SchedulerOperation(Func<Action, IDisposable> schedule, CancellationToken cancellationToken)
-            : this(schedule, cancellationToken, false)
+            : this(schedule, false, cancellationToken)
         {
         }
 
-        internal SchedulerOperation(Func<Action, IDisposable> schedule, CancellationToken cancellationToken, bool postBackToOriginalContext)
+        internal SchedulerOperation(Func<Action, IDisposable> schedule, bool postBackToOriginalContext, CancellationToken cancellationToken)
         {
             _schedule = schedule;
             _cancellationToken = cancellationToken;
@@ -36,7 +36,7 @@ namespace System.Reactive.Concurrency
         /// <returns>Scheduler operation object with configured await behavior.</returns>
         public SchedulerOperation ConfigureAwait(bool continueOnCapturedContext)
         {
-            return new SchedulerOperation(_schedule, _cancellationToken, continueOnCapturedContext);
+            return new SchedulerOperation(_schedule, continueOnCapturedContext, _cancellationToken);
         }
 
         /// <summary>
@@ -45,7 +45,7 @@ namespace System.Reactive.Concurrency
         /// <returns>Awaiter for the scheduler operation.</returns>
         public SchedulerOperationAwaiter GetAwaiter()
         {
-            return new SchedulerOperationAwaiter(_schedule, _cancellationToken, _postBackToOriginalContext);
+            return new SchedulerOperationAwaiter(_schedule, _postBackToOriginalContext, _cancellationToken);
         }
     }
 
@@ -60,7 +60,7 @@ namespace System.Reactive.Concurrency
         private readonly bool _postBackToOriginalContext;
         private readonly CancellationTokenRegistration _ctr;
 
-        internal SchedulerOperationAwaiter(Func<Action, IDisposable> schedule, CancellationToken cancellationToken, bool postBackToOriginalContext)
+        internal SchedulerOperationAwaiter(Func<Action, IDisposable> schedule, bool postBackToOriginalContext, CancellationToken cancellationToken)
         {
             _schedule = schedule;
             _cancellationToken = cancellationToken;

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerWrapper.cs

@@ -69,7 +69,7 @@ namespace System.Reactive.Concurrency
 
         public object? GetService(Type serviceType)
         {
-            if (!(_scheduler is IServiceProvider serviceProvider))
+            if (_scheduler is not IServiceProvider serviceProvider)
             {
                 return null;
             }

+ 3 - 6
Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.ObserveOn.cs

@@ -22,9 +22,8 @@ namespace System.Reactive.Concurrency
                 _scheduler = scheduler;
             }
 
-            protected override ObserveOnObserverNew<TSource> CreateSink(IObserver<TSource> observer) => new ObserveOnObserverNew<TSource>(_scheduler, observer);
+            protected override ObserveOnObserverNew<TSource> CreateSink(IObserver<TSource> observer) => new(_scheduler, observer);
 
-            [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Justification = "Visibility restricted to friend assemblies. Those should be correct by inspection.")]
             protected override void Run(ObserveOnObserverNew<TSource> sink) => sink.Run(_source);
         }
 
@@ -42,9 +41,8 @@ namespace System.Reactive.Concurrency
                 _scheduler = scheduler;
             }
 
-            protected override ObserveOnObserverLongRunning<TSource> CreateSink(IObserver<TSource> observer) => new ObserveOnObserverLongRunning<TSource>(_scheduler, observer);
+            protected override ObserveOnObserverLongRunning<TSource> CreateSink(IObserver<TSource> observer) => new(_scheduler, observer);
 
-            [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Justification = "Visibility restricted to friend assemblies. Those should be correct by inspection.")]
             protected override void Run(ObserveOnObserverLongRunning<TSource> sink) => sink.Run(_source);
         }
 
@@ -59,9 +57,8 @@ namespace System.Reactive.Concurrency
                 _context = context;
             }
 
-            protected override _ CreateSink(IObserver<TSource> observer) => new _(_context, observer);
+            protected override _ CreateSink(IObserver<TSource> observer) => new(_context, observer);
 
-            [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Justification = "Visibility restricted to friend assemblies. Those should be correct by inspection.")]
             protected override void Run(_ sink) => sink.Run(_source);
 
             internal sealed class _ : IdentitySink<TSource>

+ 1 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.Synchronize.cs

@@ -20,9 +20,8 @@ namespace System.Reactive.Concurrency
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<TSource> observer) => new _(this, observer);
+        protected override _ CreateSink(IObserver<TSource> observer) => new(this, observer);
 
-        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Justification = "Visibility restricted to friend assemblies. Those should be correct by inspection.")]
         protected override void Run(_ sink) => sink.Run(_source);
 
         internal sealed class _ : IdentitySink<TSource>

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/TaskObservationOptions.cs

@@ -85,7 +85,7 @@ namespace System.Reactive.Concurrency
         /// </remarks>
         public bool IgnoreExceptionsAfterUnsubscribe { get; }
 
-        internal Value ToValue() => new Value(this.Scheduler, this.IgnoreExceptionsAfterUnsubscribe);
+        internal Value ToValue() => new(Scheduler, IgnoreExceptionsAfterUnsubscribe);
 
         /// <summary>
         /// Value-type representation.

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs

@@ -147,7 +147,7 @@ namespace System.Reactive.Concurrency
             public bool IsDisposed => _cancel.IsDisposed;
         }
 
-        private static readonly Lazy<TaskPoolScheduler> LazyInstance = new Lazy<TaskPoolScheduler>(static () => new TaskPoolScheduler(new TaskFactory(TaskScheduler.Default)));
+        private static readonly Lazy<TaskPoolScheduler> LazyInstance = new(static () => new TaskPoolScheduler(new TaskFactory(TaskScheduler.Default)));
         private readonly TaskFactory _taskFactory;
 
         /// <summary>
@@ -272,8 +272,8 @@ namespace System.Reactive.Concurrency
             private readonly TimeSpan _period;
             private readonly TaskFactory _taskFactory;
             private readonly Func<TState, TState> _action;
-            private readonly AsyncLock _gate = new AsyncLock();
-            private readonly CancellationTokenSource _cts = new CancellationTokenSource();
+            private readonly AsyncLock _gate = new();
+            private readonly CancellationTokenSource _cts = new();
 
             public PeriodicallyScheduledWorkItem(TState state, TimeSpan period, Func<TState, TState> action, TaskFactory taskFactory)
             {

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.Windows.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Concurrency
     [CLSCompliant(false)]
     public sealed class ThreadPoolScheduler : LocalScheduler, ISchedulerPeriodic
     {
-        private static readonly Lazy<ThreadPoolScheduler> LazyDefault = new Lazy<ThreadPoolScheduler>(static () => new ThreadPoolScheduler());
+        private static readonly Lazy<ThreadPoolScheduler> LazyDefault = new(static () => new ThreadPoolScheduler());
 
         /// <summary>
         /// Constructs a ThreadPoolScheduler that schedules units of work on the Windows ThreadPool.
@@ -161,7 +161,7 @@ namespace System.Reactive.Concurrency
             private Func<TState, TState> _action;
 
             private readonly ThreadPoolTimer _timer;
-            private readonly AsyncLock _gate = new AsyncLock();
+            private readonly AsyncLock _gate = new();
 
             public PeriodicallyScheduledWorkItem(TState state, TimeSpan period, Func<TState, TState> action)
             {

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs

@@ -14,8 +14,8 @@ namespace System.Reactive.Concurrency
     /// <seealso cref="Instance">Singleton instance of this type exposed through this static property.</seealso>
     public sealed class ThreadPoolScheduler : LocalScheduler, ISchedulerLongRunning, ISchedulerPeriodic
     {
-        private static readonly Lazy<ThreadPoolScheduler> LazyInstance = new Lazy<ThreadPoolScheduler>(static () => new ThreadPoolScheduler());
-        private static readonly Lazy<NewThreadScheduler> LazyNewBackgroundThread = new Lazy<NewThreadScheduler>(static () => new NewThreadScheduler(action => new Thread(action) { IsBackground = true }));
+        private static readonly Lazy<ThreadPoolScheduler> LazyInstance = new(static () => new ThreadPoolScheduler());
+        private static readonly Lazy<NewThreadScheduler> LazyNewBackgroundThread = new(static () => new NewThreadScheduler(action => new Thread(action) { IsBackground = true }));
 
         /// <summary>
         /// Gets the singleton instance of the CLR thread pool scheduler.

+ 1 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/VirtualTimeScheduler.cs

@@ -309,7 +309,6 @@ namespace System.Reactive.Concurrency
         /// Gets the next scheduled item to be executed.
         /// </summary>
         /// <returns>The next scheduled item.</returns>
-        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "By design. Side-effecting operation to retrieve the next element.")]
         protected abstract IScheduledItem<TAbsolute>? GetNext();
 
         object? IServiceProvider.GetService(Type serviceType) => GetService(serviceType);
@@ -366,7 +365,7 @@ namespace System.Reactive.Concurrency
     public abstract class VirtualTimeScheduler<TAbsolute, TRelative> : VirtualTimeSchedulerBase<TAbsolute, TRelative>
         where TAbsolute : IComparable<TAbsolute>
     {
-        private readonly SchedulerQueue<TAbsolute> _queue = new SchedulerQueue<TAbsolute>();
+        private readonly SchedulerQueue<TAbsolute> _queue = new();
 
         /// <summary>
         /// Creates a new virtual time scheduler with the default value of TAbsolute as the initial clock value.

+ 4 - 0
Rx.NET/Source/src/System.Reactive/Diagnostics/CodeAnalysis/NullableAttributes.cs

@@ -95,7 +95,9 @@ namespace System.Diagnostics.CodeAnalysis
         /// <param name="member">
         /// The field or property member that is promised to be not-null.
         /// </param>
+#pragma warning disable CA1019 // Define accessors for attribute arguments - this needs to be identical to the real type
         public MemberNotNullAttribute(string member) => Members = new[] { member };
+#pragma warning restore CA1019
 
         /// <summary>Initializes the attribute with the list of field and property members.</summary>
         /// <param name="members">
@@ -118,7 +120,9 @@ namespace System.Diagnostics.CodeAnalysis
         /// <param name="member">
         /// The field or property member that is promised to be not-null.
         /// </param>
+#pragma warning disable CA1019 // Define accessors for attribute arguments - this needs to be identical to the real type
         public MemberNotNullWhenAttribute(bool returnValue, string member)
+#pragma warning restore CA1019
         {
             ReturnValue = returnValue;
             Members = new[] { member };

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Disposables/BooleanDisposable.cs

@@ -12,7 +12,7 @@ namespace System.Reactive.Disposables
         // Keep internal! This is used as sentinel in other IDisposable implementations to detect disposal and
         // should never be exposed to user code in order to prevent users from swapping in the sentinel. Have
         // a look at the code in e.g. SingleAssignmentDisposable for usage patterns.
-        internal static readonly BooleanDisposable True = new BooleanDisposable(true);
+        internal static readonly BooleanDisposable True = new(true);
 
         private volatile bool _isDisposed;
 

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Disposables/CompositeDisposable.cs

@@ -14,7 +14,7 @@ namespace System.Reactive.Disposables
     [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Backward compat + ideally want to get rid of the ICollection nature of the type.")]
     public sealed class CompositeDisposable : ICollection<IDisposable>, ICancelable
     {
-        private readonly object _gate = new object();
+        private readonly object _gate = new();
         private bool _disposed;
         private List<IDisposable?> _disposables;
         private int _count;
@@ -387,7 +387,7 @@ namespace System.Reactive.Disposables
         /// method to avoid allocation on disposed or empty composites.
         /// </summary>
         private static readonly CompositeEnumerator EmptyEnumerator =
-            new CompositeEnumerator(Array.Empty<IDisposable?>());
+            new(Array.Empty<IDisposable?>());
 
         /// <summary>
         /// An enumerator for an array of disposables.

+ 7 - 7
Rx.NET/Source/src/System.Reactive/Disposables/Disposable.Utils.cs

@@ -20,7 +20,7 @@ namespace System.Reactive.Disposables
         /// Gets the value stored in <paramref name="fieldRef" /> or a null if
         /// <paramref name="fieldRef" /> was already disposed.
         /// </summary>
-        internal static IDisposable? GetValue([NotNullIfNotNull("fieldRef")] /*in*/ ref IDisposable? fieldRef)
+        internal static IDisposable? GetValue([NotNullIfNotNull(nameof(fieldRef))] /*in*/ ref IDisposable? fieldRef)
         {
             var current = Volatile.Read(ref fieldRef);
 
@@ -33,8 +33,8 @@ namespace System.Reactive.Disposables
         /// Gets the value stored in <paramref name="fieldRef" /> or a no-op-Disposable if
         /// <paramref name="fieldRef" /> was already disposed.
         /// </summary>
-        [return: NotNullIfNotNull("fieldRef")]
-        internal static IDisposable? GetValueOrDefault([NotNullIfNotNull("fieldRef")] /*in*/ ref IDisposable? fieldRef)
+        [return: NotNullIfNotNull(nameof(fieldRef))]
+        internal static IDisposable? GetValueOrDefault([NotNullIfNotNull(nameof(fieldRef))] /*in*/ ref IDisposable? fieldRef)
         {
             var current = Volatile.Read(ref fieldRef);
 
@@ -47,7 +47,7 @@ namespace System.Reactive.Disposables
         /// Tries to assign <paramref name="value" /> to <paramref name="fieldRef" />.
         /// </summary>
         /// <returns>A <see cref="TrySetSingleResult"/> value indicating the outcome of the operation.</returns>
-        internal static TrySetSingleResult TrySetSingle([NotNullIfNotNull("value")] ref IDisposable? fieldRef, IDisposable? value)
+        internal static TrySetSingleResult TrySetSingle([NotNullIfNotNull(nameof(value))] ref IDisposable? fieldRef, IDisposable? value)
         {
             var old = Interlocked.CompareExchange(ref fieldRef, value, null);
             if (old == null)
@@ -70,7 +70,7 @@ namespace System.Reactive.Disposables
         /// </summary>
         /// <returns>true if <paramref name="value" /> was successfully assigned to <paramref name="fieldRef" />.</returns>
         /// <returns>false <paramref name="fieldRef" /> has been disposed.</returns>
-        internal static bool TrySetMultiple([NotNullIfNotNull("value")] ref IDisposable? fieldRef, IDisposable? value)
+        internal static bool TrySetMultiple([NotNullIfNotNull(nameof(value))] ref IDisposable? fieldRef, IDisposable? value)
         {
             // Let's read the current value atomically (also prevents reordering).
             var old = Volatile.Read(ref fieldRef);
@@ -104,7 +104,7 @@ namespace System.Reactive.Disposables
         /// </summary>
         /// <returns>true if <paramref name="value" /> was successfully assigned to <paramref name="fieldRef" />.</returns>
         /// <returns>false <paramref name="fieldRef" /> has been disposed.</returns>
-        internal static bool TrySetSerial([NotNullIfNotNull("value")] ref IDisposable? fieldRef, IDisposable? value)
+        internal static bool TrySetSerial([NotNullIfNotNull(nameof(value))] ref IDisposable? fieldRef, IDisposable? value)
         {
             var copy = Volatile.Read(ref fieldRef);
             for (; ; )
@@ -129,7 +129,7 @@ namespace System.Reactive.Disposables
         /// <summary>
         /// Disposes <paramref name="fieldRef" />. 
         /// </summary>
-        internal static void Dispose([NotNullIfNotNull("fieldRef")] ref IDisposable? fieldRef)
+        internal static void Dispose([NotNullIfNotNull(nameof(fieldRef))] ref IDisposable? fieldRef)
         {
             var old = Interlocked.Exchange(ref fieldRef, BooleanDisposable.True);
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Disposables/Disposable.cs

@@ -19,7 +19,7 @@ namespace System.Reactive.Disposables
             /// <summary>
             /// Singleton default disposable.
             /// </summary>
-            public static readonly EmptyDisposable Instance = new EmptyDisposable();
+            public static readonly EmptyDisposable Instance = new();
 
             private EmptyDisposable()
             {

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Disposables/RefCountDisposable.cs

@@ -54,7 +54,6 @@ namespace System.Reactive.Disposables
         /// </summary>
         /// <returns>A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.</returns>
         /// <exception cref="ObjectDisposedException">This instance has been disposed and is configured to throw in this case by <see cref="RefCountDisposable(IDisposable, bool)"/>.</exception>
-        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Backward compat + non-trivial work for a property getter.")]
         public IDisposable GetDisposable()
         {
             // the current state

+ 1 - 6
Rx.NET/Source/src/System.Reactive/Disposables/ScheduledDisposable.cs

@@ -21,13 +21,8 @@ namespace System.Reactive.Disposables
         /// <exception cref="ArgumentNullException"><paramref name="scheduler"/> or <paramref name="disposable"/> is null.</exception>
         public ScheduledDisposable(IScheduler scheduler, IDisposable disposable)
         {
-            if (disposable == null)
-            {
-                throw new ArgumentNullException(nameof(disposable));
-            }
-
             Scheduler = scheduler ?? throw new ArgumentNullException(nameof(scheduler));
-            _disposable.Disposable = disposable;
+            _disposable.Disposable = disposable ?? throw new ArgumentNullException(nameof(disposable));
         }
 
         /// <summary>

+ 12 - 0
Rx.NET/Source/src/System.Reactive/Disposables/SingleAssignmentDisposableValue.cs

@@ -48,5 +48,17 @@ namespace System.Reactive.Disposables
         {
             Disposables.Disposable.Dispose(ref _current);
         }
+
+        /// <inheritdoc/>
+        public override bool Equals(object? obj) => false;
+
+        /// <inheritdoc/>
+        public override int GetHashCode() => 0;
+
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required part of public API
+        public static bool operator ==(SingleAssignmentDisposableValue left, SingleAssignmentDisposableValue right) => false;
+
+        public static bool operator !=(SingleAssignmentDisposableValue left, SingleAssignmentDisposableValue right) => true;
+#pragma warning restore IDE0060
     }
 }

+ 2 - 0
Rx.NET/Source/src/System.Reactive/Disposables/StableCompositeDisposable.cs

@@ -10,6 +10,7 @@ namespace System.Reactive.Disposables
     /// <summary>
     /// Represents a group of disposable resources that are disposed together.
     /// </summary>
+#pragma warning disable CA1063 // (Overridable IDisposable.) This analyzer wants us to make breaking changes to its public API, which we can't do.
     public abstract class StableCompositeDisposable : ICancelable
     {
         /// <summary>
@@ -202,4 +203,5 @@ namespace System.Reactive.Disposables
             }
         }
     }
+#pragma warning restore CA1063
 }

+ 0 - 2
Rx.NET/Source/src/System.Reactive/EnlightenmentProvider.cs

@@ -23,9 +23,7 @@ namespace System.Reactive.PlatformServices
         /// </returns>
         public static bool EnsureLoaded()
         {
-#pragma warning disable CS0618
             return PlatformEnlightenmentProvider.Current is CurrentPlatformEnlightenmentProvider;
-#pragma warning restore CS0618
         }
     }
 }

+ 3 - 1
Rx.NET/Source/src/System.Reactive/EventPattern.cs

@@ -17,7 +17,9 @@ namespace System.Reactive
         /// </summary>
         /// <param name="sender">The sender object that raised the event.</param>
         /// <param name="e">The event data that was generated by the event.</param>
+#pragma warning disable CA2109 // (Consider making non-public.) This has long been part of the public API so we couldn't change this even if we wanted to.
         public EventPattern(object? sender, TEventArgs e)
+#pragma warning restore CA2109
             : base(sender, e)
         {
         }
@@ -56,7 +58,7 @@ namespace System.Reactive
         /// </summary>
         /// <param name="sender">The sender object that raised the event.</param>
         /// <param name="e">The event data that was generated by the event.</param>
-        public void Deconstruct(out TSender sender, out TEventArgs e) => (sender, e) = (Sender, EventArgs);
+        public void Deconstruct(out TSender? sender, out TEventArgs e) => (sender, e) = (Sender, EventArgs);
 
         /// <summary>
         /// Determines whether the current <see cref="EventPattern{TSender, TEventArgs}"/> object represents the same event as a specified <see cref="EventPattern{TSender, TEventArgs}"/> object.

+ 1 - 1
Rx.NET/Source/src/System.Reactive/EventPatternSourceBase.cs

@@ -20,7 +20,7 @@ namespace System.Reactive
             private bool _isDone;
             private bool _isAdded;
             private readonly Delegate _handler;
-            private readonly object _gate = new object();
+            private readonly object _gate = new();
             private readonly Action<TSender?, TEventArgs> _invoke;
             private readonly EventPatternSourceBase<TSender, TEventArgs> _sourceBase;
 

+ 31 - 191
Rx.NET/Source/src/System.Reactive/GlobalSuppressions.cs

@@ -12,203 +12,43 @@
 // "In Project Suppression File".
 // You do not need to add suppressions to this file manually.
 
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System", Justification = "By design.")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Taken care of by lab build.")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1016:MarkAssembliesWithAssemblyVersion", Justification = "Taken care of by lab build.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.Reactive.Concurrency.LocalScheduler+WorkItem.#CompareTo(System.Reactive.Concurrency.LocalScheduler+WorkItem)", Justification = "Checked all enqueue operations against null reference insertions.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive", Justification = "By design.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.Disposables", Justification = "By design.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.Linq", Justification = "By design.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.Subjects", Justification = "By design.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.Concurrency", Justification = "By design.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.Linq", Justification = "By design.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.Threading.Tasks", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "~M:System.Reactive.Concurrency.LocalScheduler.WorkItem.CompareTo(System.Reactive.Concurrency.LocalScheduler.WorkItem)~System.Int32", Justification = "Checked all enqueue operations against null reference insertions.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.Disposables", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.Linq", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.Subjects", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.Concurrency", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.Linq", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.Threading.Tasks", Justification = "By design.")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Taken care of by lab build.")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1016:MarkAssembliesWithAssemblyVersion", Justification = "Taken care of by lab build.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AddRef`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Aggregate`2.#Run(System.IObserver`1<!1>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Aggregate`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.All`1.#Run(System.IObserver`1<System.Boolean>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Amb`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Any`1.#Run(System.IObserver`1<System.Boolean>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AsObservable`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageDecimal.#Run(System.IObserver`1<System.Decimal>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageDecimalNullable.#Run(System.IObserver`1<System.Nullable`1<System.Decimal>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageDouble.#Run(System.IObserver`1<System.Double>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageDoubleNullable.#Run(System.IObserver`1<System.Nullable`1<System.Double>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageInt32.#Run(System.IObserver`1<System.Double>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageInt32Nullable.#Run(System.IObserver`1<System.Nullable`1<System.Double>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageInt64.#Run(System.IObserver`1<System.Double>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageInt64Nullable.#Run(System.IObserver`1<System.Nullable`1<System.Double>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageSingle.#Run(System.IObserver`1<System.Single>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.AverageSingleNullable.#Run(System.IObserver`1<System.Nullable`1<System.Single>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Buffer`2.#Run(System.IObserver`1<System.Collections.Generic.IList`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Buffer`1.#Run(System.IObserver`1<System.Collections.Generic.IList`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Cast`2.#Run(System.IObserver`1<!1>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Catch`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Catch`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`17.#Run(System.IObserver`1<!16>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`16.#Run(System.IObserver`1<!15>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`15.#Run(System.IObserver`1<!14>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`14.#Run(System.IObserver`1<!13>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`13.#Run(System.IObserver`1<!12>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`12.#Run(System.IObserver`1<!11>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`11.#Run(System.IObserver`1<!10>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`10.#Run(System.IObserver`1<!9>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`9.#Run(System.IObserver`1<!8>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`8.#Run(System.IObserver`1<!7>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`7.#Run(System.IObserver`1<!6>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`6.#Run(System.IObserver`1<!5>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`5.#Run(System.IObserver`1<!4>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`4.#Run(System.IObserver`1<!3>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`3.#Run(System.IObserver`1<!2>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.CombineLatest`2.#Run(System.IObserver`1<!1>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Concat`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Contains`1.#Run(System.IObserver`1<System.Boolean>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Count`1.#Run(System.IObserver`1<System.Int32>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.DefaultIfEmpty`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Defer`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Delay`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Delay`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.DelaySubscription`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Dematerialize`1+_.#OnNext(System.Reactive.Notification`1<!0>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Dematerialize`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Distinct`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.DistinctUntilChanged`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Do`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.Reactive.Either`2+Left.#Switch(System.Action`1<!0>,System.Action`1<!1>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.Reactive.Either`2+Left.#Switch`1(System.Func`2<!0,!!0>,System.Func`2<!1,!!0>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "System.Reactive.Either`2+Right.#Switch(System.Action`1<!0>,System.Action`1<!1>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "System.Reactive.Either`2+Right.#Switch`1(System.Func`2<!0,!!0>,System.Func`2<!1,!!0>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.ElementAt`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Empty`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Finally`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.FirstAsync`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Generate`2.#Run(System.IObserver`1<!1>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.GroupBy`3.#Run(System.IObserver`1<System.Reactive.Linq.IGroupedObservable`2<!1,!2>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.GroupByUntil`4.#Run(System.IObserver`1<System.Reactive.Linq.IGroupedObservable`2<!1,!2>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.GroupJoin`5.#Run(System.IObserver`1<!4>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.IgnoreElements`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.IsEmpty`1.#Run(System.IObserver`1<System.Boolean>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Join`5.#Run(System.IObserver`1<!4>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.Reactive.Joins.JoinObserver`1.#OnNextCore(System.Reactive.Notification`1<!0>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.LastAsync`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.LongCount`1.#Run(System.IObserver`1<System.Int64>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Materialize`1.#Run(System.IObserver`1<System.Reactive.Notification`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Max`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxBy`2.#Run(System.IObserver`1<System.Collections.Generic.IList`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxDecimal.#Run(System.IObserver`1<System.Decimal>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxDecimalNullable.#Run(System.IObserver`1<System.Nullable`1<System.Decimal>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxDouble.#Run(System.IObserver`1<System.Double>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxDoubleNullable.#Run(System.IObserver`1<System.Nullable`1<System.Double>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxInt32.#Run(System.IObserver`1<System.Int32>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxInt32Nullable.#Run(System.IObserver`1<System.Nullable`1<System.Int32>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxInt64.#Run(System.IObserver`1<System.Int64>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxInt64Nullable.#Run(System.IObserver`1<System.Nullable`1<System.Int64>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxSingle.#Run(System.IObserver`1<System.Single>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MaxSingleNullable.#Run(System.IObserver`1<System.Nullable`1<System.Single>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Merge`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Min`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinBy`2.#Run(System.IObserver`1<System.Collections.Generic.IList`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinDecimal.#Run(System.IObserver`1<System.Decimal>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinDecimalNullable.#Run(System.IObserver`1<System.Nullable`1<System.Decimal>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinDouble.#Run(System.IObserver`1<System.Double>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinDoubleNullable.#Run(System.IObserver`1<System.Nullable`1<System.Double>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinInt32.#Run(System.IObserver`1<System.Int32>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinInt32Nullable.#Run(System.IObserver`1<System.Nullable`1<System.Int32>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinInt64.#Run(System.IObserver`1<System.Int64>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinInt64Nullable.#Run(System.IObserver`1<System.Nullable`1<System.Int64>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinSingle.#Run(System.IObserver`1<System.Single>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.MinSingleNullable.#Run(System.IObserver`1<System.Nullable`1<System.Single>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Multicast`3.#Run(System.IObserver`1<!2>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.OfType`2.#Run(System.IObserver`1<!1>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.OnErrorResumeNext`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Range.#Run(System.IObserver`1<System.Int32>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.RefCount`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Repeat`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Return`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Sample`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Sample`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Scan`2.#Run(System.IObserver`1<!1>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Scan`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Select`2.#Run(System.IObserver`1<!1>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SelectMany`3.#Run(System.IObserver`1<!2>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SelectMany`2.#Run(System.IObserver`1<!1>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SequenceEqual`1.#Run(System.IObserver`1<System.Boolean>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SingleAsync`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Skip`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SkipLast`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SkipUntil`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SkipUntil`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SkipWhile`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumDecimal.#Run(System.IObserver`1<System.Decimal>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumDecimalNullable.#Run(System.IObserver`1<System.Nullable`1<System.Decimal>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumDouble.#Run(System.IObserver`1<System.Double>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumDoubleNullable.#Run(System.IObserver`1<System.Nullable`1<System.Double>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumInt32.#Run(System.IObserver`1<System.Int32>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumInt32Nullable.#Run(System.IObserver`1<System.Nullable`1<System.Int32>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumInt64.#Run(System.IObserver`1<System.Int64>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumInt64Nullable.#Run(System.IObserver`1<System.Nullable`1<System.Int64>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumSingle.#Run(System.IObserver`1<System.Single>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.SumSingleNullable.#Run(System.IObserver`1<System.Nullable`1<System.Single>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Switch`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Take`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.TakeLast`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.TakeUntil`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.TakeUntil`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.TakeWhile`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Throttle`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Throttle`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Throw`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.TimeInterval`1.#Run(System.IObserver`1<System.Reactive.TimeInterval`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Timeout`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Timeout`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Timer.#Run(System.IObserver`1<System.Int64>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Timestamp`1.#Run(System.IObserver`1<System.Reactive.Timestamped`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.ToArray`1.#Run(System.IObserver`1<!0[]>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.ToDictionary`3.#Run(System.IObserver`1<System.Collections.Generic.IDictionary`2<!1,!2>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.ToList`1.#Run(System.IObserver`1<System.Collections.Generic.IList`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.ToLookup`3.#Run(System.IObserver`1<System.Linq.ILookup`2<!1,!2>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.ToObservable`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Using`2.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Where`1.#Run(System.IObserver`1<!0>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Window`2.#Run(System.IObserver`1<System.IObservable`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Window`1.#Run(System.IObserver`1<System.IObservable`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`17.#Run(System.IObserver`1<!16>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`16.#Run(System.IObserver`1<!15>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`15.#Run(System.IObserver`1<!14>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`14.#Run(System.IObserver`1<!13>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`13.#Run(System.IObserver`1<!12>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`12.#Run(System.IObserver`1<!11>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`11.#Run(System.IObserver`1<!10>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`10.#Run(System.IObserver`1<!9>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`9.#Run(System.IObserver`1<!8>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`8.#Run(System.IObserver`1<!7>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`7.#Run(System.IObserver`1<!6>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`6.#Run(System.IObserver`1<!5>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`4.#Run(System.IObserver`1<!3>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`3.#Run(System.IObserver`1<!2>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`1.#Run(System.IObserver`1<System.Collections.Generic.IList`1<!0>>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "2", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.Zip`5.#Run(System.IObserver`1<!4>,System.IDisposable,System.Action`1<System.IDisposable>)", Justification = "Producer cannot pass null to setSink parameter.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", Scope = "member", Target = "System.Reactive.Linq.ObservableImpl.ElementAt`1+_.#OnCompleted()", Justification = "Asynchronous behavior; no more index parameter in scope.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.Concurrency", Justification = "By design.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.PlatformServices", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "~M:System.Reactive.Linq.ObservableImpl.Dematerialize`1._.OnNext(System.Reactive.Notification{`0})", Justification = "Producer cannot pass null to setSink parameter.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "~M:System.Reactive.Either`2.Left.Switch(System.Action{`0},System.Action{`1})", Justification = "Producer cannot pass null to setSink parameter.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "~M:System.Reactive.Either`2.Left.Switch``1(System.Func{`0,``0},System.Func{`1,``0})~``0", Justification = "Producer cannot pass null to setSink parameter.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "~M:System.Reactive.Either`2.Right.Switch(System.Action{`0},System.Action{`1})", Justification = "Producer cannot pass null to setSink parameter.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "~M:System.Reactive.Either`2.Right.Switch``1(System.Func{`0,``0},System.Func{`1,``0})~``0", Justification = "Producer cannot pass null to setSink parameter.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "~M:System.Reactive.Joins.JoinObserver`1.OnNextCore(System.Reactive.Notification{`0})", Justification = "Producer cannot pass null to setSink parameter.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", Scope = "member", Target = "~M:System.Reactive.Linq.ObservableImpl.ElementAt`1._.OnCompleted", Justification = "Asynchronous behavior; no more index parameter in scope.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.Concurrency", Justification = "By design.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.PlatformServices", Justification = "By design.")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Taken care of by lab build.")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1016:MarkAssembliesWithAssemblyVersion", Justification = "Taken care of by lab build.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Reactive.Linq", Justification = "By design")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "type", Target = "System.Reactive.Linq.IQbservable", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "type", Target = "System.Reactive.Linq.IQbservable`1", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "type", Target = "System.Reactive.Linq.IQbservableProvider", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "type", Target = "System.Reactive.Linq.Qbservable", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Amb", Scope = "member", Target = "System.Reactive.Linq.Qbservable.#Amb`1(System.Reactive.Linq.IQbservable`1<!!0>,System.IObservable`1<!!0>)", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Amb", Scope = "member", Target = "System.Reactive.Linq.Qbservable.#Amb`1(System.Reactive.Linq.IQbservableProvider,System.Collections.Generic.IEnumerable`1<System.IObservable`1<!!0>>)", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Amb", Scope = "member", Target = "System.Reactive.Linq.Qbservable.#Amb`1(System.Reactive.Linq.IQbservableProvider,System.IObservable`1<!!0>[])", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "member", Target = "System.Reactive.Linq.Qbservable.#AsQbservable`1(System.IObservable`1<!!0>)", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Scope = "member", Target = "System.Reactive.Linq.Qbservable.#Remotable`1(System.Reactive.Linq.IQbservable`1<!!0>)", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "member", Target = "System.Reactive.Linq.Qbservable.#ToQbservable`1(System.Linq.IQueryable`1<!!0>)", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "~N:System.Reactive.Linq", Justification = "By design")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "type", Target = "~T:System.Reactive.Linq.IQbservable", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "type", Target = "~T:System.Reactive.Linq.IQbservable`1", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "type", Target = "~T:System.Reactive.Linq.IQbservableProvider", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "type", Target = "~T:System.Reactive.Linq.Qbservable", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Amb", Scope = "member", Target = "~M:System.Reactive.Linq.Qbservable.Amb``1(System.Reactive.Linq.IQbservable{``0},System.IObservable{``0})~System.Reactive.Linq.IQbservable{``0}", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Amb", Scope = "member", Target = "~M:System.Reactive.Linq.Qbservable.Amb``1(System.Reactive.Linq.IQbservableProvider,System.Collections.Generic.IEnumerable{System.IObservable{``0}})~System.Reactive.Linq.IQbservable{``0}", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Amb", Scope = "member", Target = "~M:System.Reactive.Linq.Qbservable.Amb``1(System.Reactive.Linq.IQbservableProvider,System.IObservable{``0}[])~System.Reactive.Linq.IQbservable{``0}", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "member", Target = "~M:System.Reactive.Linq.Qbservable.AsQbservable``1(System.IObservable{``0})~System.Reactive.Linq.IQbservable{``0}", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "member", Target = "~M:System.Reactive.Linq.Qbservable.ToQbservable``1(System.Linq.IQueryable{``0})~System.Reactive.Linq.IQbservable{``0}", Justification = "It's homoiconic, dude!")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "resource", Target = "System.Reactive.Strings_Providers.resources", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "member", Target = "System.Reactive.Linq.Qbservable.#ToQbservable`1(System.Linq.IQueryable`1<!!0>,System.Reactive.Concurrency.IScheduler)", Justification = "It's homoiconic, dude!")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.Reactive.ObservableQuery`1+ObservableRewriter.#VisitConstant(System.Linq.Expressions.ConstantExpression)", Justification = "Expression visitor should not pass in null references.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.Reactive.ObservableQuery`1+ObservableRewriter.#VisitMethodCall(System.Linq.Expressions.MethodCallExpression)", Justification = "Expression visitor should not pass in null references.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Qbservable", Scope = "member", Target = "~M:System.Reactive.Linq.Qbservable.ToQbservable``1(System.Linq.IQueryable{``0},System.Reactive.Concurrency.IScheduler)~System.Reactive.Linq.IQbservable{``0}", Justification = "It's homoiconic, dude!")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "~M:System.Reactive.ObservableQuery`1.ObservableRewriter.VisitConstant(System.Linq.Expressions.ConstantExpression)~System.Linq.Expressions.Expression", Justification = "Expression visitor should not pass in null references.")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "~M:System.Reactive.ObservableQuery`1.ObservableRewriter.VisitMethodCall(System.Linq.Expressions.MethodCallExpression)~System.Linq.Expressions.Expression", Justification = "Expression visitor should not pass in null references.")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Taken care of by lab build.")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1016:MarkAssembliesWithAssemblyVersion", Justification = "Taken care of by lab build.")]

+ 1 - 2
Rx.NET/Source/src/System.Reactive/IEventSource.cs

@@ -16,8 +16,7 @@ namespace System.Reactive
         /// <summary>
         /// Event signaling the next element in the data stream.
         /// </summary>
-        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "By design.")]
-        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1009:DeclareEventHandlersCorrectly", Justification = "Can't do this for Action<T>.")]
+        [Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1003:Use generic event handler instances", Justification = "Can't do this for Action<T>.")]
         event Action<T> OnNext;
     }
 }

+ 4 - 0
Rx.NET/Source/src/System.Reactive/Internal/ExceptionServices.Default.cs

@@ -14,9 +14,13 @@ namespace System.Reactive.PlatformServices
     //
     internal sealed class DefaultExceptionServices/*Impl*/ : IExceptionServices
     {
+#if NO_NULLABLE_ATTRIBUTES
 #pragma warning disable CS8763 // NB: On down-level platforms, Throw is not marked as DoesNotReturn.
+#endif
         [DoesNotReturn]
         public void Rethrow(Exception exception) => ExceptionDispatchInfo.Capture(exception).Throw();
+#if NO_NULLABLE_ATTRIBUTES
 #pragma warning restore CS8763
+#endif
     }
 }

+ 1 - 3
Rx.NET/Source/src/System.Reactive/Internal/ExceptionServices.cs

@@ -10,16 +10,14 @@ namespace System.Reactive
 {
     internal static class ExceptionHelpers
     {
-        private static readonly Lazy<IExceptionServices> Services = new Lazy<IExceptionServices>(Initialize);
+        private static readonly Lazy<IExceptionServices> Services = new(Initialize);
 
         [DoesNotReturn]
         public static void Throw(this Exception exception) => Services.Value.Rethrow(exception);
 
         private static IExceptionServices Initialize()
         {
-#pragma warning disable CS0618 // Type or member is obsolete
             return PlatformEnlightenmentProvider.Current.GetService<IExceptionServices>() ?? new DefaultExceptionServices();
-#pragma warning restore CS0618 // Type or member is obsolete
         }
     }
 }

+ 4 - 0
Rx.NET/Source/src/System.Reactive/Internal/ExceptionServicesImpl.cs

@@ -14,9 +14,13 @@ namespace System.Reactive.PlatformServices
     //
     internal sealed class /*Default*/ExceptionServicesImpl : IExceptionServices
     {
+#if NO_NULLABLE_ATTRIBUTES
 #pragma warning disable CS8763 // NB: On down-level platforms, Throw is not marked as DoesNotReturn.
+#endif
         [DoesNotReturn]
         public void Rethrow(Exception exception) => ExceptionDispatchInfo.Capture(exception).Throw();
+#if NO_NULLABLE_ATTRIBUTES
 #pragma warning restore CS8763
+#endif
     }
 }

+ 1 - 3
Rx.NET/Source/src/System.Reactive/Internal/HostLifecycleService.cs

@@ -13,7 +13,7 @@ namespace System.Reactive.PlatformServices
     [EditorBrowsable(EditorBrowsableState.Never)]
     public static class HostLifecycleService
     {
-        private static readonly Lazy<IHostLifecycleNotifications?> Notifications = new Lazy<IHostLifecycleNotifications?>(InitializeNotifications);
+        private static readonly Lazy<IHostLifecycleNotifications?> Notifications = new(InitializeNotifications);
 
         private static int _refCount;
 
@@ -72,9 +72,7 @@ namespace System.Reactive.PlatformServices
 
         private static IHostLifecycleNotifications? InitializeNotifications()
         {
-#pragma warning disable CS0618 // Type or member is obsolete
             return PlatformEnlightenmentProvider.Current.GetService<IHostLifecycleNotifications>();
-#pragma warning restore CS0618 // Type or member is obsolete
         }
     }
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Internal/ImmutableList.cs

@@ -6,7 +6,7 @@ namespace System.Reactive
 {
     internal sealed class ImmutableList<T>
     {
-        public static readonly ImmutableList<T> Empty = new ImmutableList<T>();
+        public static readonly ImmutableList<T> Empty = new();
 
         private readonly T[] _data;
 

+ 3 - 9
Rx.NET/Source/src/System.Reactive/Internal/PriorityQueue.cs

@@ -37,12 +37,9 @@ namespace System.Reactive
 
             var parent = (index - 1) / 2;
             while (parent >= 0 && parent != index && IsHigherPriority(index, parent))
-            { 
+            {
                 // swap index and parent
-                var temp = _items[index];
-                _items[index] = _items[parent];
-                _items[parent] = temp;
-
+                (_items[parent], _items[index]) = (_items[index], _items[parent]);
                 index = parent;
                 parent = (index - 1) / 2;
             }
@@ -79,10 +76,7 @@ namespace System.Reactive
                 }
 
                 // swap index and first
-                var temp = _items[index];
-                _items[index] = _items[first];
-                _items[first] = temp;
-
+                (_items[first], _items[index]) = (_items[index], _items[first]);
                 index = first;
             }
         }

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Internal/QueryServices.cs

@@ -14,9 +14,7 @@ namespace System.Reactive.Linq
 
         private static IQueryServices Initialize()
         {
-#pragma warning disable CS0618 // Type or member is obsolete
             return PlatformEnlightenmentProvider.Current.GetService<IQueryServices>() ?? new DefaultQueryServices();
-#pragma warning restore CS0618 // Type or member is obsolete
         }
     }
 

+ 2 - 17
Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs

@@ -44,23 +44,8 @@ namespace System.Reactive
                 }
             }
 
-            var add = e.GetAddMethod();
-
-            if (add == null)
-            {
-                throw new InvalidOperationException(Strings_Linq.EVENT_MISSING_ADD_METHOD);
-            }
-
-            addMethod = add;
-
-            var remove = e.GetRemoveMethod();
-
-            if (remove == null)
-            {
-                throw new InvalidOperationException(Strings_Linq.EVENT_MISSING_REMOVE_METHOD);
-            }
-
-            removeMethod = remove;
+            addMethod = e.GetAddMethod() ?? throw new InvalidOperationException(Strings_Linq.EVENT_MISSING_ADD_METHOD);
+            removeMethod = e.GetRemoveMethod() ?? throw new InvalidOperationException(Strings_Linq.EVENT_MISSING_REMOVE_METHOD);
 
             var psa = addMethod.GetParameters();
             if (psa.Length != 1)

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Internal/ScheduledObserver.cs

@@ -18,7 +18,7 @@ namespace System.Reactive
         private const int Running = 1;
         private const int Pending = 2;
         private const int Faulted = 9;
-        private readonly ConcurrentQueue<T> _queue = new ConcurrentQueue<T>();
+        private readonly ConcurrentQueue<T> _queue = new();
         private bool _failed;
         private Exception? _error;
         private bool _completed;
@@ -55,7 +55,7 @@ namespace System.Reactive
             }
         }
 
-        private readonly object _dispatcherInitGate = new object();
+        private readonly object _dispatcherInitGate = new();
         private readonly SemaphoreSlim? _dispatcherEvent;
         private readonly IDisposable? _dispatcherEventRelease;
         private IDisposable? _dispatcherJob;
@@ -204,7 +204,7 @@ namespace System.Reactive
 
         private void Run(object? state, Action<object?> recurse)
         {
-            T next;
+            T? next;
 
             while (!_queue.TryDequeue(out next))
             {

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs

@@ -18,7 +18,7 @@ namespace System.Reactive
 
     internal static class TimerStubs
     {
-        public static readonly System.Threading.Timer Never = new System.Threading.Timer(static _ => { });
+        public static readonly System.Threading.Timer Never = new(static _ => { });
     }
 }
 

+ 4 - 11
Rx.NET/Source/src/System.Reactive/Internal/SystemClock.cs

@@ -19,9 +19,9 @@ namespace System.Reactive.PlatformServices
     [EditorBrowsable(EditorBrowsableState.Never)]
     public static class SystemClock
     {
-        private static readonly Lazy<ISystemClock> ServiceSystemClock = new Lazy<ISystemClock>(InitializeSystemClock);
-        private static readonly Lazy<INotifySystemClockChanged> ServiceSystemClockChanged = new Lazy<INotifySystemClockChanged>(InitializeSystemClockChanged);
-        internal static readonly HashSet<WeakReference<LocalScheduler>> SystemClockChanged = new HashSet<WeakReference<LocalScheduler>>();
+        private static readonly Lazy<ISystemClock> ServiceSystemClock = new(InitializeSystemClock);
+        private static readonly Lazy<INotifySystemClockChanged> ServiceSystemClockChanged = new(InitializeSystemClockChanged);
+        internal static readonly HashSet<WeakReference<LocalScheduler>> SystemClockChanged = new();
         private static IDisposable? _systemClockChangedHandlerCollector;
 
         private static int _refCount;
@@ -73,16 +73,12 @@ namespace System.Reactive.PlatformServices
 
         private static ISystemClock InitializeSystemClock()
         {
-#pragma warning disable CS0618 // Type or member is obsolete
             return PlatformEnlightenmentProvider.Current.GetService<ISystemClock>() ?? new DefaultSystemClock();
-#pragma warning restore CS0618 // Type or member is obsolete
         }
 
         private static INotifySystemClockChanged InitializeSystemClockChanged()
         {
-#pragma warning disable CS0618 // Type or member is obsolete
             return PlatformEnlightenmentProvider.Current.GetService<INotifySystemClockChanged>() ?? new DefaultSystemClockMonitor();
-#pragma warning restore CS0618 // Type or member is obsolete
         }
 
         internal static void Register(LocalScheduler scheduler)
@@ -127,10 +123,7 @@ namespace System.Reactive.PlatformServices
                 {
                     if (!handler.TryGetTarget(out _))
                     {
-                        if (remove == null)
-                        {
-                            remove = new HashSet<WeakReference<LocalScheduler>>();
-                        }
+                        remove ??= new HashSet<WeakReference<LocalScheduler>>();
 
                         remove.Add(handler);
                     }

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Internal/TailRecursiveSink.cs

@@ -11,7 +11,7 @@ namespace System.Reactive
 {
     internal abstract class TailRecursiveSink<TSource> : IdentitySink<TSource>
     {
-        private readonly Stack<IEnumerator<IObservable<TSource>>> _stack = new Stack<IEnumerator<IObservable<TSource>>>();
+        private readonly Stack<IEnumerator<IObservable<TSource>>> _stack = new();
 
         private bool _isDisposed;
         private int _trampoline;

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Internal/TaskExtensions.cs

@@ -6,7 +6,7 @@ namespace System.Threading.Tasks
 {
     internal static class TaskExtensions
     {
-        public static Task ContinueWithState<TState>(this Task task, Action<Task, TState> continuationAction, TState state, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions)
+        public static Task ContinueWithState<TState>(this Task task, Action<Task, TState> continuationAction, TState state, TaskContinuationOptions continuationOptions, CancellationToken cancellationToken)
         {
             return task.ContinueWith(
                 (t, tupleObject) =>
@@ -34,7 +34,7 @@ namespace System.Threading.Tasks
                 cancellationToken);
         }
 
-        public static Task ContinueWithState<TResult, TState>(this Task<TResult> task, Action<Task<TResult>, TState> continuationAction, TState state, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions)
+        public static Task ContinueWithState<TResult, TState>(this Task<TResult> task, Action<Task<TResult>, TState> continuationAction, TState state, TaskContinuationOptions continuationOptions, CancellationToken cancellationToken)
         {
             return task.ContinueWith(
                 (t, tupleObject) =>

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Joins/ActivePlan.cs

@@ -8,7 +8,7 @@ namespace System.Reactive.Joins
 {
     internal abstract class ActivePlan
     {
-        private readonly Dictionary<IJoinObserver, IJoinObserver> _joinObservers = new Dictionary<IJoinObserver, IJoinObserver>();
+        private readonly Dictionary<IJoinObserver, IJoinObserver> _joinObservers = new();
 
         protected readonly Action _onCompleted;
 

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.NAry.cs

@@ -2,11 +2,11 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-// This code was generated by a T4 template at 10/05/2020 14:25:54.
+// This code was generated by a T4 template at 05/04/2023 16:16:14.
 
 namespace System.Reactive.Linq
 {
-    partial interface IQueryLanguage
+    internal partial interface IQueryLanguage
     {
         IObservable<TResult> CombineLatest<T1, T2, TResult>(IObservable<T1> source1, IObservable<T2> source2, Func<T1, T2, TResult> resultSelector);
         IObservable<TResult> CombineLatest<T1, T2, T3, TResult>(IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, Func<T1, T2, T3, TResult> resultSelector);
@@ -41,7 +41,7 @@ namespace System.Reactive.Linq
         IObservable<TResult> Zip<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>(IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, IObservable<T10> source10, IObservable<T11> source11, IObservable<T12> source12, IObservable<T13> source13, IObservable<T14> source14, IObservable<T15> source15, IObservable<T16> source16, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> resultSelector);
     }
 
-    partial interface IQueryLanguageEx
+    internal partial interface IQueryLanguageEx
     {
         IObservable<(T1, T2)> CombineLatest<T1, T2>(IObservable<T1> source1, IObservable<T2> source2);
         IObservable<(T1, T2, T3)> CombineLatest<T1, T2, T3>(IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3);

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.NAry.tt

@@ -12,7 +12,7 @@
 
 namespace System.Reactive.Linq
 {
-    partial interface IQueryLanguage
+    internal partial interface IQueryLanguage
     {
 <#
 for (int i = 2; i <= 16; i++)
@@ -39,7 +39,7 @@ for (int i = 2; i <= 16; i++)
 #>
     }
 
-    partial interface IQueryLanguageEx
+    internal partial interface IQueryLanguageEx
     {
 <#
 for (int i = 2; i <= 8; i++)

+ 10 - 10
Rx.NET/Source/src/System.Reactive/Linq/Observable.Binding.cs

@@ -251,12 +251,12 @@ namespace System.Reactive.Linq
         {
             if (source == null)
             {
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             }
 
             if (disconnectDelay < TimeSpan.Zero)
             {
-                throw new ArgumentException("Delay cannot be less than zero", "disconnectDelay");
+                throw new ArgumentException("Delay cannot be less than zero", nameof(disconnectDelay));
             }
 
             return s_impl.RefCount(source, disconnectDelay);
@@ -275,17 +275,17 @@ namespace System.Reactive.Linq
         {
             if (source == null)
             {
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             }
 
             if (scheduler == null)
             {
-                throw new ArgumentNullException("scheduler");
+                throw new ArgumentNullException(nameof(scheduler));
             }
 
             if (disconnectDelay < TimeSpan.Zero)
             {
-                throw new ArgumentException("Delay cannot be less than zero", "disconnectDelay");
+                throw new ArgumentException("Delay cannot be less than zero", nameof(disconnectDelay));
             }
 
             return s_impl.RefCount(source, disconnectDelay, scheduler);
@@ -328,12 +328,12 @@ namespace System.Reactive.Linq
         {
             if (source == null)
             {
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             }
 
             if (disconnectDelay < TimeSpan.Zero)
             {
-                throw new ArgumentException("Delay cannot be less than zero", "disconnectDelay");
+                throw new ArgumentException("Delay cannot be less than zero", nameof(disconnectDelay));
             }
             if (minObservers <= 0)
             {
@@ -358,17 +358,17 @@ namespace System.Reactive.Linq
         {
             if (source == null)
             {
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             }
 
             if (scheduler == null)
             {
-                throw new ArgumentNullException("scheduler");
+                throw new ArgumentNullException(nameof(scheduler));
             }
 
             if (disconnectDelay < TimeSpan.Zero)
             {
-                throw new ArgumentException("Delay cannot be less than zero", "disconnectDelay");
+                throw new ArgumentException("Delay cannot be less than zero", nameof(disconnectDelay));
             }
             if (minObservers <= 0)
             {

+ 4 - 0
Rx.NET/Source/src/System.Reactive/Linq/Observable.Blocking.cs

@@ -451,7 +451,9 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">The source sequence contains more than one element. -or- The source sequence is empty.</exception>
         /// <seealso cref="Observable.SingleAsync{TSource}(IObservable{TSource})"/>
         [Obsolete(Constants_Linq.UseAsync)]
+#pragma warning disable CA1720 // (Identifier contains type name.) Single is long-established as a LINQ method name.
         public static TSource Single<TSource>(this IObservable<TSource> source)
+#pragma warning restore CA1720
         {
             if (source == null)
             {
@@ -472,7 +474,9 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">No element satisfies the condition in the predicate. -or- More than one element satisfies the condition in the predicate. -or- The source sequence is empty.</exception>
         /// <seealso cref="Observable.SingleAsync{TSource}(IObservable{TSource}, Func{TSource, bool})"/>
         [Obsolete(Constants_Linq.UseAsync)]
+#pragma warning disable CA1720 // (Identifier contains type name.) Single is long-established as a LINQ method name.
         public static TSource Single<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
+#pragma warning restore CA1720
         {
             if (source == null)
             {

+ 10 - 0
Rx.NET/Source/src/System.Reactive/Linq/Observable.Creation.cs

@@ -295,7 +295,9 @@ namespace System.Reactive.Linq
         /// <typeparam name="TResult">The type used for the <see cref="IObservable{T}"/> type parameter of the resulting sequence.</typeparam>
         /// <param name="witness">Object solely used to infer the type of the <typeparamref name="TResult"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>An observable sequence with no elements.</returns>
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required for type inference
         public static IObservable<TResult> Empty<TResult>(TResult witness)
+#pragma warning restore IDE0060
         {
             return s_impl.Empty<TResult>(); // Pure inference - no specialized target method.
         }
@@ -325,7 +327,9 @@ namespace System.Reactive.Linq
         /// <param name="witness">Object solely used to infer the type of the <typeparamref name="TResult"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>An observable sequence with no elements.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="scheduler"/> is null.</exception>
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required for type inference
         public static IObservable<TResult> Empty<TResult>(IScheduler scheduler, TResult witness)
+#pragma warning restore IDE0060
         {
             if (scheduler == null)
             {
@@ -427,7 +431,9 @@ namespace System.Reactive.Linq
         /// <typeparam name="TResult">The type used for the <see cref="IObservable{T}"/> type parameter of the resulting sequence.</typeparam>
         /// <param name="witness">Object solely used to infer the type of the <typeparamref name="TResult"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>An observable sequence whose observers will never get called.</returns>
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required for type inference
         public static IObservable<TResult> Never<TResult>(TResult witness)
+#pragma warning restore IDE0060
         {
             return s_impl.Never<TResult>(); // Pure inference - no specialized target method.
         }
@@ -617,7 +623,9 @@ namespace System.Reactive.Linq
         /// <param name="witness">Object solely used to infer the type of the <typeparamref name="TResult"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>The observable sequence that terminates exceptionally with the specified exception object.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="exception"/> is null.</exception>
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required for type inference
         public static IObservable<TResult> Throw<TResult>(Exception exception, TResult witness)
+#pragma warning restore IDE0060
         {
             if (exception == null)
             {
@@ -659,7 +667,9 @@ namespace System.Reactive.Linq
         /// <param name="witness">Object solely used to infer the type of the <typeparamref name="TResult"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>The observable sequence that terminates exceptionally with the specified exception object.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="exception"/> or <paramref name="scheduler"/> is null.</exception>
+#pragma warning disable IDE0060 // (Remove unused parameter.) Required for type inference
         public static IObservable<TResult> Throw<TResult>(Exception exception, IScheduler scheduler, TResult witness)
+#pragma warning restore IDE0060
         {
             if (exception == null)
             {

+ 2 - 0
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs

@@ -1193,7 +1193,9 @@ namespace System.Reactive.Linq
 
     }
 
+#pragma warning disable CA1711 // (Don't use Ex suffix.) This has been a public type for many years, so we can't rename it now.
     public static partial class ObservableEx
+#pragma warning restore CA1711
     {
         /// <summary>
         /// Merges the specified observable sequences into one observable sequence of tuple values whenever any of the observable sequences produces an element.

+ 2 - 0
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs

@@ -1179,7 +1179,9 @@ namespace System.Reactive.Linq
 
     }
 
+#pragma warning disable CA1711 // (Don't use Ex suffix.) This has been a public type for many years, so we can't rename it now.
     public static partial class ObservableEx
+#pragma warning restore CA1711
     {
         /// <summary>
         /// Merges the specified observable sequences into one observable sequence of tuple values whenever all of the observable sequences have produced an element at a corresponding index.

+ 2 - 0
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.cs

@@ -1128,7 +1128,9 @@ namespace System.Reactive.Linq
         #endregion
     }
 
+#pragma warning disable CA1711 // (Don't use Ex suffix.) This has been a public type for many years, so we can't rename it now.
     public static partial class ObservableEx
+#pragma warning restore CA1711
     {
         /// <summary>
         /// Merges two observable sequences into one observable sequence by combining each element from the first source with the latest element from the second source, if any.

+ 3 - 8
Rx.NET/Source/src/System.Reactive/Linq/Observable.Queryable.cs

@@ -2,9 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#pragma warning disable 1591
-
+#if HAS_TRIMMABILITY_ATTRIBUTES
 using System.Diagnostics.CodeAnalysis;
+#endif
 
 namespace System.Reactive.Linq
 {
@@ -24,10 +24,7 @@ namespace System.Reactive.Linq
         {
             get
             {
-                if (s_provider == null)
-                {
-                    s_provider = new ObservableQueryProvider();
-                }
+                s_provider ??= new ObservableQueryProvider();
 
                 return s_provider;
             }
@@ -51,5 +48,3 @@ namespace System.Reactive.Linq
         }
     }
 }
-
-#pragma warning restore 1591

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/AddRef.cs

@@ -17,7 +17,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _refCount = refCount;
         }
 
-        protected override _ CreateSink(IObserver<TSource> observer) => new _(observer, _refCount.GetDisposable());
+        protected override _ CreateSink(IObserver<TSource> observer) => new(observer, _refCount.GetDisposable());
 
         protected override void Run(_ sink) => sink.Run(_source);
 

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Linq/Observable/Aggregate.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _accumulator = accumulator;
         }
 
-        protected override _ CreateSink(IObserver<TSource> observer) => new _(_accumulator, observer);
+        protected override _ CreateSink(IObserver<TSource> observer) => new(_accumulator, observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -95,7 +95,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _accumulator = accumulator;
         }
 
-        protected override _ CreateSink(IObserver<TAccumulate> observer) => new _(_seed, _accumulator, observer);
+        protected override _ CreateSink(IObserver<TAccumulate> observer) => new(_seed, _accumulator, observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -155,7 +155,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(this, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(this, observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/All.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _predicate = predicate;
         }
 
-        protected override _ CreateSink(IObserver<bool> observer) => new _(_predicate, observer);
+        protected override _ CreateSink(IObserver<bool> observer) => new(_predicate, observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Amb.cs

@@ -17,7 +17,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _right = right;
         }
 
-        protected override AmbCoordinator CreateSink(IObserver<TSource> observer) => new AmbCoordinator(observer);
+        protected override AmbCoordinator CreateSink(IObserver<TSource> observer) => new(observer);
 
         protected override void Run(AmbCoordinator sink) => sink.Run(_left, _right);
 

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/Any.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _source = source;
             }
 
-            protected override _ CreateSink(IObserver<bool> observer) => new _(observer);
+            protected override _ CreateSink(IObserver<bool> observer) => new(observer);
 
             protected override void Run(_ sink) => sink.Run(_source);
 
@@ -51,7 +51,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _predicate = predicate;
             }
 
-            protected override _ CreateSink(IObserver<bool> observer) => new _(_predicate, observer);
+            protected override _ CreateSink(IObserver<bool> observer) => new(_predicate, observer);
 
             protected override void Run(_ sink) => sink.Run(_source);
 

+ 4 - 4
Rx.NET/Source/src/System.Reactive/Linq/Observable/AppendPrepend.cs

@@ -95,7 +95,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 Scheduler = scheduler;
             }
 
-            protected override _ CreateSink(IObserver<TSource> observer) => new _(this, observer);
+            protected override _ CreateSink(IObserver<TSource> observer) => new(this, observer);
 
             protected override void Run(_ sink) => sink.Run();
 
@@ -189,7 +189,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     new Node<TSource>(_prepends, value), _appends, Scheduler);
             }
 
-            protected override _ CreateSink(IObserver<TSource> observer) => new _(this, observer);
+            protected override _ CreateSink(IObserver<TSource> observer) => new(this, observer);
 
             protected override void Run(_ sink) => sink.Run();
 
@@ -352,7 +352,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     new Node<TSource>(_prepends, value), _appends, Scheduler, _longRunningScheduler);
             }
 
-            protected override _ CreateSink(IObserver<TSource> observer) => new _(this, observer);
+            protected override _ CreateSink(IObserver<TSource> observer) => new(this, observer);
 
             protected override void Run(_ sink) => sink.Run();
 
@@ -508,7 +508,7 @@ namespace System.Reactive.Linq.ObservableImpl
             {
             }
 
-            protected override _ CreateSink(IObserver<TSource> observer) => new _(this, observer);
+            protected override _ CreateSink(IObserver<TSource> observer) => new(this, observer);
 
             protected override void Run(_ sink) => sink.Run();
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/AsObservable.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
         public IObservable<TSource> Eval() => _source;
 
-        protected override _ CreateSink(IObserver<TSource> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<TSource> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 

+ 10 - 10
Rx.NET/Source/src/System.Reactive/Linq/Observable/Average.cs

@@ -13,7 +13,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<double> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<double> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -76,7 +76,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<float> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<float> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -139,7 +139,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<decimal> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<decimal> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -202,7 +202,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<double> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<double> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -265,7 +265,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<double> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<double> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -328,7 +328,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<double?> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<double?> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -388,7 +388,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<float?> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<float?> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -448,7 +448,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<decimal?> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<decimal?> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -508,7 +508,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<double?> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<double?> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -568,7 +568,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<double?> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<double?> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 

+ 19 - 19
Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs

@@ -21,7 +21,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _count = count;
             }
 
-            protected override ExactSink CreateSink(IObserver<IList<TSource>> observer) => new ExactSink(observer, _count);
+            protected override ExactSink CreateSink(IObserver<IList<TSource>> observer) => new(observer, _count);
 
             protected override void Run(ExactSink sink) => sink.Run(_source);
 
@@ -93,7 +93,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _skip = skip;
             }
 
-            protected override SkipSink CreateSink(IObserver<IList<TSource>> observer) => new SkipSink(observer, _count, _skip);
+            protected override SkipSink CreateSink(IObserver<IList<TSource>> observer) => new(observer, _count, _skip);
 
             protected override void Run(SkipSink sink) => sink.Run(_source);
 
@@ -171,7 +171,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _skip = skip;
             }
 
-            protected override OverlapSink CreateSink(IObserver<IList<TSource>> observer) => new OverlapSink(observer, _count, _skip);
+            protected override OverlapSink CreateSink(IObserver<IList<TSource>> observer) => new(observer, _count, _skip);
 
             protected override void Run(OverlapSink sink) => sink.Run(_source);
 
@@ -260,7 +260,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _scheduler = scheduler;
             }
 
-            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new _(this, observer);
+            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new(this, observer);
 
             protected override void Run(_ sink) => sink.Run(this);
 
@@ -268,8 +268,8 @@ namespace System.Reactive.Linq.ObservableImpl
             {
                 private readonly TimeSpan _timeShift;
                 private readonly IScheduler _scheduler;
-                private readonly object _gate = new object();
-                private readonly Queue<List<TSource>> _q = new Queue<List<TSource>>();
+                private readonly object _gate = new();
+                private readonly Queue<List<TSource>> _q = new();
                 private SerialDisposableValue _timerSerial;
 
                 public _(TimeSliding parent, IObserver<IList<TSource>> observer)
@@ -429,14 +429,14 @@ namespace System.Reactive.Linq.ObservableImpl
                 _scheduler = scheduler;
             }
 
-            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new _(observer);
+            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new(observer);
 
             protected override void Run(_ sink) => sink.Run(this);
 
             internal sealed class _ : Sink<TSource, IList<TSource>>
             {
-                private readonly object _gate = new object();
-                private List<TSource> _list = new List<TSource>();
+                private readonly object _gate = new();
+                private List<TSource> _list = new();
 
                 public _(IObserver<IList<TSource>> observer)
                     : base(observer)
@@ -513,15 +513,15 @@ namespace System.Reactive.Linq.ObservableImpl
                 _scheduler = scheduler;
             }
 
-            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new _(this, observer);
+            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new(this, observer);
 
             protected override void Run(_ sink) => sink.Run();
 
             internal sealed class _ : Sink<TSource, IList<TSource>>
             {
                 private readonly Ferry _parent;
-                private readonly object _gate = new object();
-                private List<TSource> _s = new List<TSource>();
+                private readonly object _gate = new();
+                private List<TSource> _s = new();
 
                 public _(Ferry parent, IObserver<IList<TSource>> observer)
                     : base(observer)
@@ -643,17 +643,17 @@ namespace System.Reactive.Linq.ObservableImpl
                 _bufferClosingSelector = bufferClosingSelector;
             }
 
-            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new _(this, observer);
+            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new(this, observer);
 
             protected override void Run(_ sink) => sink.Run(_source);
 
             internal sealed class _ : Sink<TSource, IList<TSource>>
             {
-                private readonly object _gate = new object();
-                private readonly AsyncLock _bufferGate = new AsyncLock();
+                private readonly object _gate = new();
+                private readonly AsyncLock _bufferGate = new();
                 private readonly Func<IObservable<TBufferClosing>> _bufferClosingSelector;
 
-                private List<TSource> _buffer = new List<TSource>();
+                private List<TSource> _buffer = new();
                 private SerialDisposableValue _bufferClosingSerialDisposable;
 
                 public _(Selector parent, IObserver<IList<TSource>> observer)
@@ -777,15 +777,15 @@ namespace System.Reactive.Linq.ObservableImpl
                 _bufferBoundaries = bufferBoundaries;
             }
 
-            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new _(observer);
+            protected override _ CreateSink(IObserver<IList<TSource>> observer) => new(observer);
 
             protected override void Run(_ sink) => sink.Run(this);
 
             internal sealed class _ : Sink<TSource, IList<TSource>>
             {
-                private readonly object _gate = new object();
+                private readonly object _gate = new();
 
-                private List<TSource> _buffer = new List<TSource>();
+                private List<TSource> _buffer = new();
                 private SingleAssignmentDisposableValue _boundariesDisposable;
 
                 public _(IObserver<IList<TSource>> observer)

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Case.cs

@@ -30,7 +30,7 @@ namespace System.Reactive.Linq.ObservableImpl
             return _defaultSource;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(this);
 

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Linq/Observable/Cast.cs

@@ -13,7 +13,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _source = source;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 
@@ -26,10 +26,10 @@ namespace System.Reactive.Linq.ObservableImpl
 
             public override void OnNext(TSource value)
             {
-                TResult result;
+                TResult? result;
                 try
                 {
-                    result = (TResult)(object?)value;
+                    result = (TResult?)(object?)value;
                 }
                 catch (Exception exception)
                 {

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/Catch.cs

@@ -17,7 +17,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _sources = sources;
         }
 
-        protected override _ CreateSink(IObserver<TSource> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<TSource> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_sources);
 
@@ -82,7 +82,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _handler = handler;
         }
 
-        protected override _ CreateSink(IObserver<TSource> observer) => new _(_handler, observer);
+        protected override _ CreateSink(IObserver<TSource> observer) => new(_handler, observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 

+ 14 - 14
Rx.NET/Source/src/System.Reactive/Linq/Observable/CombineLatest.NAry.cs

@@ -27,7 +27,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3);
 
@@ -85,7 +85,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4);
 
@@ -149,7 +149,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5);
 
@@ -219,7 +219,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6);
 
@@ -295,7 +295,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7);
 
@@ -377,7 +377,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8);
 
@@ -465,7 +465,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8, _source9);
 
@@ -559,7 +559,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8, _source9, _source10);
 
@@ -659,7 +659,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8, _source9, _source10, _source11);
 
@@ -765,7 +765,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8, _source9, _source10, _source11, _source12);
 
@@ -877,7 +877,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8, _source9, _source10, _source11, _source12, _source13);
 
@@ -995,7 +995,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8, _source9, _source10, _source11, _source12, _source13, _source14);
 
@@ -1119,7 +1119,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8, _source9, _source10, _source11, _source12, _source13, _source14, _source15);
 
@@ -1249,7 +1249,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_source1, _source2, _source3, _source4, _source5, _source6, _source7, _source8, _source9, _source10, _source11, _source12, _source13, _source14, _source15, _source16);
 

+ 4 - 4
Rx.NET/Source/src/System.Reactive/Linq/Observable/CombineLatest.cs

@@ -24,14 +24,14 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_first, _second);
 
         internal sealed class _ : IdentitySink<TResult>
         {
             private readonly Func<TFirst, TSecond, TResult> _resultSelector;
-            private readonly object _gate = new object();
+            private readonly object _gate = new();
 
             public _(Func<TFirst, TSecond, TResult> resultSelector, IObserver<TResult> observer)
                 : base(observer)
@@ -385,13 +385,13 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelector = resultSelector;
         }
 
-        protected override _ CreateSink(IObserver<TResult> observer) => new _(_resultSelector, observer);
+        protected override _ CreateSink(IObserver<TResult> observer) => new(_resultSelector, observer);
 
         protected override void Run(_ sink) => sink.Run(_sources);
 
         internal sealed class _ : IdentitySink<TResult>
         {
-            private readonly object _gate = new object();
+            private readonly object _gate = new();
             private readonly Func<IList<TSource>, TResult> _resultSelector;
 
             public _(Func<IList<TSource>, TResult> resultSelector, IObserver<TResult> observer)

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Concat.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _sources = sources;
         }
 
-        protected override _ CreateSink(IObserver<TSource> observer) => new _(observer);
+        protected override _ CreateSink(IObserver<TSource> observer) => new(observer);
 
         protected override void Run(_ sink) => sink.Run(_sources);
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Contains.cs

@@ -19,7 +19,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _comparer = comparer;
         }
 
-        protected override _ CreateSink(IObserver<bool> observer) => new _(this, observer);
+        protected override _ CreateSink(IObserver<bool> observer) => new(this, observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/Count.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _source = source;
             }
 
-            protected override _ CreateSink(IObserver<int> observer) => new _(observer);
+            protected override _ CreateSink(IObserver<int> observer) => new(observer);
 
             protected override void Run(_ sink) => sink.Run(_source);
 
@@ -62,7 +62,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _predicate = predicate;
             }
 
-            protected override _ CreateSink(IObserver<int> observer) => new _(_predicate, observer);
+            protected override _ CreateSink(IObserver<int> observer) => new(_predicate, observer);
 
             protected override void Run(_ sink) => sink.Run(_source);
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/DefaultIfEmpty.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _defaultValue = defaultValue;
         }
 
-        protected override _ CreateSink(IObserver<TSource> observer) => new _(_defaultValue, observer);
+        protected override _ CreateSink(IObserver<TSource> observer) => new(_defaultValue, observer);
 
         protected override void Run(_ sink) => sink.Run(_source);
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Defer.cs

@@ -13,7 +13,7 @@ namespace System.Reactive.Linq.ObservableImpl
             _observableFactory = observableFactory;
         }
 
-        protected override _ CreateSink(IObserver<TValue> observer) => new _(_observableFactory, observer);
+        protected override _ CreateSink(IObserver<TValue> observer) => new(_observableFactory, observer);
 
         protected override void Run(_ sink) => sink.Run();
 

部分文件因为文件数量过多而无法显示