Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-469422: Quick fix for the code Inspection 'Ternary expression has identical true and false branches' works incorrectly

$
0
0
Reporter Dmitry Matveev (dmitry.matveev@jetbrains.com) Dmitry Matveev (dmitry.matveev@jetbrains.com)
Created Apr 26, 2018 4:00:32 PM
Updated Apr 26, 2018 4:00:32 PM
Subsystem Quick Fixes
Assignee Alexander Shvedov (shvedov)
Priority Normal
State Submitted
Type Bug
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
A strange thing is happening in R# 2018.1. Using this refactoring it transforms
ViewBag.UserHasCompany = CurrentUser != null && CurrentUser.CompanyId.HasValue;
into
ViewBag.UserHasCompany = !(CurrentUser?.CompanyId).HasValue;
which is not right. e.g. when CurrentUser.CompanyId is not null, the first one evaluates to true, the second one to false.


https://www.jetbrains.com/help/resharper/ConditionalTernaryEqualBranch.html#comment-3873569268

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>