"To object pattern" - incorrect changes with nullable value type

Given a property of a nullable value type, R# suggests changing the following code:

if (foo.Bar is int x)

to:

if (foo.Bar is {} x)

This is incorrect. In the original code, x is int; in the refactored code, x is Nullable<int>.

VS2019 v16.3.9
R# 2019.2.3

0
2 comments

Hello Richard,

 

Sorry for delay in responding.

Please try installing the latest ReSharper 2019.3 EAP build https://www.jetbrains.com/resharper/eap/ and check the same issue once again.

Thank you.

0

I've just tried the final release of 2019.3; I didn't get around to testing whether it fixes this problem, because the intellisense / autocomplete is so badly broken I had to roll back.

0

Please sign in to leave a comment.