Skip to content

Commit 1a5abeb

Browse files
committed
Emit a warning if the half-serializer ignores a value in ForwardOnNext.
(cherry picked from commit 7d2d4c4)
1 parent 1990de7 commit 1a5abeb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Rx.NET/Source/Directory.build.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project>
22
<!-- This props all need to be set in targets as they depend on the values set earlier -->
33
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
4-
<DefineConstants>$(DefineConstants);HAS_WINRT;PREFER_ASYNC;HAS_TPL46;DESKTOPCLR</DefineConstants>
4+
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;DESKTOPCLR</DefineConstants>
55
</PropertyGroup>
66
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
77
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
88
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
99
<DefineConstants>$(DefineConstants);NO_CODE_COVERAGE_ATTRIBUTE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;NO_SERIALIZABLE;CRIPPLED_REFLECTION;NO_THREAD;WINDOWS</DefineConstants>
1010
</PropertyGroup>
1111
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
12-
<DefineConstants>$(DefineConstants);HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;WINDOWS</DefineConstants>
12+
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;WINDOWS</DefineConstants>
1313
</PropertyGroup>
1414
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.0'">
15-
<DefineConstants>$(DefineConstants);HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
15+
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
1616
</PropertyGroup>
1717
</Project>

Rx.NET/Source/src/System.Reactive/Internal/HalfSerializer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information.
44

5+
using System.Diagnostics;
56
using System.Threading;
67

78
namespace System.Reactive
@@ -47,6 +48,10 @@ public static void ForwardOnNext<T>(ISink<T> sink, T item, ref int wip, ref Exce
4748
}
4849
}
4950
}
51+
#if (HAS_TRACE)
52+
else if (error == null)
53+
Trace.TraceWarning("OnNext called while another OnNext call was in progress on the same Observer.");
54+
#endif
5055
}
5156

5257
/// <summary>

0 commit comments

Comments
 (0)