We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
out T?
out T
No warnings when compiling:
#nullable enable abstract class A { public abstract void F<T>(out T t); } class B : A { public override void F<T>(out T? t) where T : default { t = default; } }
Expected: A warning for B.F<T>():
B.F<T>()
(10,26): warning CS8765: Nullability of type of parameter 't' doesn't match overridden member
The text was updated successfully, but these errors were encountered:
The root cause could be similar to #49071
Sorry, something went wrong.
out T? and out T wont warn for partial either, so it's probably the exact same issue.
We permit covariant nullables for output types, out and partial return type would be an exception..
out
These signatures appears to be contravariant (override signature accepts a less specific type, which is only safe for inputs).
cston
Successfully merging a pull request may close this issue.
No warnings when compiling:
Expected: A warning for
B.F<T>()
:The text was updated successfully, but these errors were encountered: