Add nullable annotations to System.Threading.Timer ref assembly (dotnet/corefx#38284)
authorSantiago Fernandez Madero <safern@microsoft.com>
Fri, 14 Jun 2019 03:16:26 +0000 (20:16 -0700)
committerStephen Toub <stoub@microsoft.com>
Fri, 14 Jun 2019 03:16:26 +0000 (23:16 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/c3f4524c785a226bae79cc82a96f7525460e2b5e

src/libraries/System.Threading.Timer/ref/System.Threading.Timer.cs
src/libraries/System.Threading.Timer/ref/System.Threading.Timer.csproj

index 7f660bb..9f98ec7 100644 (file)
@@ -10,20 +10,20 @@ namespace System.Threading
     public sealed partial class Timer : System.MarshalByRefObject, System.IAsyncDisposable, System.IDisposable
     {
         public Timer(System.Threading.TimerCallback callback) { }
-        public Timer(System.Threading.TimerCallback callback, object state, int dueTime, int period) { }
-        public Timer(System.Threading.TimerCallback callback, object state, long dueTime, long period) { }
-        public Timer(System.Threading.TimerCallback callback, object state, System.TimeSpan dueTime, System.TimeSpan period) { }
+        public Timer(System.Threading.TimerCallback callback, object? state, int dueTime, int period) { }
+        public Timer(System.Threading.TimerCallback callback, object? state, long dueTime, long period) { }
+        public Timer(System.Threading.TimerCallback callback, object? state, System.TimeSpan dueTime, System.TimeSpan period) { }
         [System.CLSCompliantAttribute(false)]
-        public Timer(System.Threading.TimerCallback callback, object state, uint dueTime, uint period) { }
+        public Timer(System.Threading.TimerCallback callback, object? state, uint dueTime, uint period) { }
+        public static long ActiveCount { get { throw null; } }
         public bool Change(int dueTime, int period) { throw null; }
         public bool Change(long dueTime, long period) { throw null; }
         public bool Change(System.TimeSpan dueTime, System.TimeSpan period) { throw null; }
         [System.CLSCompliantAttribute(false)]
         public bool Change(uint dueTime, uint period) { throw null; }
-        public static long ActiveCount { get { throw null; } }
         public void Dispose() { }
         public bool Dispose(System.Threading.WaitHandle notifyObject) { throw null; }
         public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
     }
-    public delegate void TimerCallback(object state);
+    public delegate void TimerCallback(object? state);
 }
index c4b5835..214b18b 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <ProjectGuid>{DC78B562-4F74-49C2-9766-3B65CD610CCC}</ProjectGuid>
     <Configurations>netcoreapp-Debug;netcoreapp-Release;uap-Debug;uap-Release</Configurations>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="System.Threading.Timer.cs" />