-
Notifications
You must be signed in to change notification settings - Fork 86
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
[Epic] Specify nullable reference types in C# 8 #1085
Comments
Are MaybeNullWhenAttribute and others going to be standardised? |
Yes, see #1092 |
Does any of those issues cover how variance of generic parameters should affect warnings about identity conversions: using System;
public class C {
// f1 is a delegate that takes string? and returns string.
public void M(Func<string?, string> f1) {
// Nullability of type arguments does not match,
// but there is no warning, because of variance.
Func<string, string?> f2 = f1;
// Convert back to the original type.
// This causes a warning.
Func<string?, string> f3 = f2;
}
} https://github.com/dotnet/csharplang/blob/main/proposals/csharp-9.0/nullable-reference-types-specification.md doesn't seem to mention this. I'm not sure whether this behaviour is C# 8 or 9, but I guess 8. |
Terminology question: Do we want to use "nullable context" or "null analysis context"? Alternative is "set the flags in the nullable context". See https://github.com/dotnet/csharpstandard/pull/1123/files#r1672741166 However, note that the null state analysis is always being done. The comment states that the context may impact that. |
#700 is a draft which will be useful, but we're going to try to do this in multiple small PRs.
The current planned task list is:
The text was updated successfully, but these errors were encountered: