if (previousChangeNotifications != null && nextChangeNotifications != null)
{
// Notifications can't exist without values
- Debug.Assert(previousExecutionCtx!.m_localValues != null); // TODO-NULLABLE: Compiler can't see that we're only here when this is non-null
- Debug.Assert(nextExecutionCtx!.m_localValues != null); // TODO-NULLABLE: Compiler can't see that we're only here when this is non-null
+ Debug.Assert(previousExecutionCtx!.m_localValues != null); // TODO-NULLABLE: https://github.com/dotnet/csharplang/issues/2388
+ Debug.Assert(nextExecutionCtx!.m_localValues != null); // TODO-NULLABLE: https://github.com/dotnet/csharplang/issues/2388
// Both contexts have change notifications, check previousExecutionCtx first
foreach (IAsyncLocal local in previousChangeNotifications)
{
else if (previousChangeNotifications != null)
{
// Notifications can't exist without values
- Debug.Assert(previousExecutionCtx!.m_localValues != null); // TODO-NULLABLE: Compiler can't see that we're only here when this is non-null
+ Debug.Assert(previousExecutionCtx!.m_localValues != null); // TODO-NULLABLE: https://github.com/dotnet/csharplang/issues/2388
// No current values, so just check previous against null
foreach (IAsyncLocal local in previousChangeNotifications)
{
else // Implied: nextChangeNotifications != null
{
// Notifications can't exist without values
- Debug.Assert(nextExecutionCtx!.m_localValues != null); // TODO-NULLABLE: Compiler can't see that we're only here when this is non-null
+ Debug.Assert(nextExecutionCtx!.m_localValues != null); // TODO-NULLABLE: https://github.com/dotnet/csharplang/issues/2388
// No previous values, so just check current against null
foreach (IAsyncLocal local in nextChangeNotifications!) // TODO-NULLABLE: https://github.com/dotnet/csharplang/issues/2388
{
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
using System.Collections.Generic;
using System.Diagnostics;
{
if (!_isScheduled)
{
- List<TimerQueue> timers = s_scheduledTimers;
+ List<TimerQueue>? timers = s_scheduledTimers;
if (timers == null)
{
timers = InitializeScheduledTimerManager_Locked();
private static void TimerThread()
{
AutoResetEvent timerEvent = s_timerEvent;
- List<TimerQueue> timersToFire = s_scheduledTimersToFire;
+ List<TimerQueue> timersToFire = s_scheduledTimersToFire!;
List<TimerQueue> timers;
lock (timerEvent)
{
- timers = s_scheduledTimers;
+ timers = s_scheduledTimers!;
}
int shortestWaitDurationMs = Timeout.Infinite;