-
I experimented a little with the using something like if (obj is not { } nonNullObj) return)
nonNullObj.ToString(); // throws a null exception because nonNullObj is null. this is counter-intuitive to me since I would have expected
to be equivalent to
which properly initialized On top of that if (new object is not { } nonNullObj) return)
nonNullObj.ToString(); actually works fine. Maybe I am misunderstanding something here? I also opened a ticket on StackOverflow for this issue with some unit tests that reproduce the behavior. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Seems like already fixed bug dotnet/roslyn#49708 |
Beta Was this translation helpful? Give feedback.
-
@ufcpp Any idea when the fix will be released? |
Beta Was this translation helpful? Give feedback.
Seems like already fixed bug dotnet/roslyn#49708