NotNullIfNotNull is not recognized inside a generic method body. #45612
Unanswered
manfred-brands
asked this question in
General
Replies: 1 comment 1 reply
-
My interpretation here is that while you have There are two possible solutions to this:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version Used:
VS 2019 16.6.2
C# 8 with nullability enabled.
Steps to Reproduce:
Expected Behavior:
No CS8603 raised at the return defaultValue statement.
Actual Behavior:
CS8603 is raised at the return defaultValue statement.
Adding [return: MaybeNull] removes the CS8603 in the first function, but then raises it in the second.
It is related to 36039 which fixed it for MaybeNull.
Beta Was this translation helpful? Give feedback.
All reactions