Metriche repository
- Star
- (20.414 star)
- Metriche merge PR
- (Merge medio 6g 17h) (256 PR mergiate in 30 g)
Descrizione
Version Used: 5.3.0-2.25603.1
Similar to #78152, but for events, both static and non-static.
Steps to Reproduce:
using System;
public class C {
public event Action OnEvent;
}
Diagnostic Id:
CS8618 Non-nullable event 'OnEvent' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the event as nullable.
Expected Behavior:
The error message is:
CS8618 Non-nullable event 'OnEvent' must contain a non-null value when exiting constructor. Consider
adding the 'required' modifier ordeclaring the event as nullable.
Actual Behavior:
The error message gives wrong advice. Adding the required modifier results in error CS0106 The modifier 'required' is not valid for this item.