-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finish nullable. now enabled globally #1729
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Couple of minor queries :-)
@@ -67,7 +68,7 @@ internal LogEventProperty(EventProperty property) | |||
/// </summary> | |||
/// <param name="name">The name to check.</param> | |||
/// <returns>True if the name is valid; otherwise, false.</returns> | |||
public static bool IsValidName(string name) => !string.IsNullOrWhiteSpace(name); | |||
public static bool IsValidName([NotNullWhen(true)] string? name) => !string.IsNullOrWhiteSpace(name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the attribute makes sense here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this we get build errors, since the compiler cant derive the nullability
Logger.cs(1369, 65): [CS8604] Possible null reference argument for parameter 'name' in 'LogEventProperty MessageTemplateProcessor.CreateProperty(string name, object? value, bool destructureObjects = false)'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! TIL, thanks 👍
* nullable in LogEventProperty * nullable in JsonValueFormatter * nullable in EventProperty * nullable in LogContext * enable nullable for EnricherStack * remove "#nullable enable" and enable globally * Update Logger.cs
No description provided.