Replies: 1 comment 12 replies
-
This is intentional. You can't change a struct substitution to a |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Example assume I want to provide a nullable wrapper for dictionary's TryGetValue
this gives you
Cannot convert null to type parameter 'TVal' because it could be a non-nullable value type. Consider using 'default(TVal)' instead.
Now this is terrible advice if you actually do this i.e.
null
->default
theninstead what you actually have to do (like you did in c# 8.0)
All of it coming from the fact that
null
is not valid return type from something that returns[type]?
which is obviously incorrect.Beta Was this translation helpful? Give feedback.
All reactions