Replies: 6 comments
-
I assume this is applicable? dotnet/roslyn#12514 (comment) |
Beta Was this translation helpful? Give feedback.
-
This is not specific to bool though. Reference types are the same way. So long as the comparison you do implies |
Beta Was this translation helpful? Give feedback.
-
@jnm2 Right, there is also no special behavior specified for definitely assigned when non-null. |
Beta Was this translation helpful? Give feedback.
-
@gafter Cool. Is there any reason we couldn't have it? |
Beta Was this translation helpful? Give feedback.
-
@jnm2 Right now “it” is mythical. It would be very complex to specify, implement, and test, for little value to programmers. |
Beta Was this translation helpful? Give feedback.
-
I think we may want to revisit this with nullable changes proposed for C# 8, still hitting this fairly often. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would expect
a
to be definitely assigned since== true
implies!= null
which meansTryA
was definitely executed (sharplab):Is there a good reason for this or is it just not implemented yet?
Beta Was this translation helpful? Give feedback.
All reactions