Version Used:
16.3.7 / 16.4.0 Preview 3.0
Steps to Reproduce:
#nullable enable
using System;
public class Test
{
private event EventHandler<EventArgs>? myEvent;
public void M() => myEvent += handler; // Run "Generate Method" here
}
Run the "Generate Method" quick fix for handler and note the nullability annotation on the sender parameter.
Expected Behavior:
+ private void handler(object? sender, EventArgs e) => throw new NotImplementedException();
To match the EventHandler delegate, sender should be typed object?.
Actual Behavior:
+ private void handler(object sender, EventArgs e) => throw new NotImplementedException();
The sender parameter is missing the nullable annotation resulting in an immediate warning.

Version Used:
16.3.7 / 16.4.0 Preview 3.0
Steps to Reproduce:
Run the "Generate Method" quick fix for
handlerand note the nullability annotation on thesenderparameter.Expected Behavior:
+ private void handler(object? sender, EventArgs e) => throw new NotImplementedException();To match the
EventHandlerdelegate,sendershould be typedobject?.Actual Behavior:
+ private void handler(object sender, EventArgs e) => throw new NotImplementedException();The
senderparameter is missing the nullable annotation resulting in an immediate warning.