Add nullable annotations to System.Runtime.InteropServices.WindowsRuntime ref (dotnet...
authorSantiago Fernandez Madero <safern@microsoft.com>
Wed, 19 Jun 2019 17:32:59 +0000 (10:32 -0700)
committerGitHub <noreply@github.com>
Wed, 19 Jun 2019 17:32:59 +0000 (10:32 -0700)
* Add nullable annotations to System.Runtime.InteropServices.WindowsRuntime ref

* Apply nullable attributes

Commit migrated from https://github.com/dotnet/corefx/commit/36ff261d4ec19933dde77c11c78256f62a5a4487

src/libraries/System.Runtime.InteropServices.WindowsRuntime/ref/System.Runtime.InteropServices.WindowsRuntime.cs
src/libraries/System.Runtime.InteropServices.WindowsRuntime/ref/System.Runtime.InteropServices.WindowsRuntime.csproj

index e531b50..edd4a16 100644 (file)
@@ -16,7 +16,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
     public partial struct EventRegistrationToken
     {
         private int _dummyPrimitive;
-        public override bool Equals(object obj) { throw null; }
+        public override bool Equals(object? obj) { throw null; }
         public override int GetHashCode() { throw null; }
         public static bool operator ==(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken left, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken right) { throw null; }
         public static bool operator !=(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken left, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken right) { throw null; }
@@ -24,9 +24,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime
     public sealed partial class EventRegistrationTokenTable<T> where T : class
     {
         public EventRegistrationTokenTable() { }
+        [System.Diagnostics.CodeAnalysis.MaybeNullAttribute]
         public T InvocationList { get { throw null; } set { } }
         public System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken AddEventHandler(T handler) { throw null; }
-        public static System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T> GetOrCreateEventRegistrationTokenTable(ref System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T> refEventTable) { throw null; }
+        public static System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T> GetOrCreateEventRegistrationTokenTable(ref System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T>? refEventTable) { throw null; }
         public void RemoveEventHandler(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken token) { }
         public void RemoveEventHandler(T handler) { }
     }
index f0490a4..4fcf8b7 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <ProjectGuid>{DC485335-D0D7-4E28-9593-445B7B6BEFA7}</ProjectGuid>
     <Configurations>netcoreapp-Debug;netcoreapp-Release;uap-Debug;uap-Release</Configurations>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="System.Runtime.InteropServices.WindowsRuntime.cs" />