ReferenceAssemblyAnnotator creates SocketAsyncEventArgs.Completed with a bizarre nullable event args parameter:
No diagnostic should be shown here. When compiling on net6.0, there is no diagnostic for this sample code.
I decompiled %userprofile\.nuget\packages\microsoft.netcore.app.ref\6.0.0\ref\net6.0\System.Net.Sockets.dll and confirmed that it has public event EventHandler<SocketAsyncEventArgs>? Completed;, not public event EventHandler<SocketAsyncEventArgs?>? Completed;.
Repro
using System.Net.Sockets;
var x = new SocketAsyncEventArgs();
// ⚠️ CS8622 Nullability of reference types in type of parameter 'e' of 'void OnCompleted(object? sender,
// SocketAsyncEventArgs e)' doesn't match the target delegate 'EventHandler<SocketAsyncEventArgs?>' (possibly
// because of nullability attributes).
// ↓↓↓↓↓↓↓↓↓↓↓
x.Completed += OnCompleted;
void OnCompleted(object? sender, SocketAsyncEventArgs e)
{
}
ReferenceAssemblyAnnotator creates SocketAsyncEventArgs.Completed with a bizarre nullable event args parameter:
No diagnostic should be shown here. When compiling on
net6.0
, there is no diagnostic for this sample code.I decompiled
%userprofile\.nuget\packages\microsoft.netcore.app.ref\6.0.0\ref\net6.0\System.Net.Sockets.dll
and confirmed that it haspublic event EventHandler<SocketAsyncEventArgs>? Completed;
, notpublic event EventHandler<SocketAsyncEventArgs?>? Completed;
.Repro