You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[severity:It bothers me. A fix would be nice]
My code:
var local = VirtualProperty;
#if DEBUG
if (local == null)// IDE0270.
throw new Exception();
#endif
The suggested fix gives this:
var local = VirtualProperty ?? throw new Exception();
#if DEBUG
#endif
That's obviously a change in behaviour for moving the exception out of the #if, but it shouldn't be trying to use a coalesce expression at all because it would require the ; to be after the #endif which is super ugly:
var local = VirtualProperty
#if DEBUG
?? throw new Exception()
#endif
;
Leaving my original code without any suggestion would be ideal.
Original Comments
Feedback Bot on 10/23/2023, 00:11 AM:
(private comment, text removed)
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered:
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice]
My code:
The suggested fix gives this:
That's obviously a change in behaviour for moving the exception out of the
#if
, but it shouldn't be trying to use a coalesce expression at all because it would require the;
to be after the#endif
which is super ugly:Leaving my original code without any suggestion would be ideal.
Original Comments
Feedback Bot on 10/23/2023, 00:11 AM:
(private comment, text removed)
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered: