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

RSRP-287587: If statement with early exit does not flag inverse if statements as always true

$
0
0
Reporter Kevin Bost (Keboo) Kevin Bost (Keboo)
Created Jan 4, 2012 9:33:56 PM
Updated Jan 5, 2012 12:21:47 AM
Resolved Jan 5, 2012 12:21:47 AM
Priority Normal
Type Bug
Fix versions No Fix versions
State Won't fix
Assignee Evgeny Pasynkov (pasynkov)
Subsystem Code Analysis - Control Flow
Affected versions 6.1.1
Fixed in build No Fixed in build
Consider the following code:
if (item == null)
return;
if (item != null)
{
//Do work
}

It is important to note that "item" is a private field. Method parameters and method variables do not appear to have this issue.

I would expect R# to flag the second if condition since it must always be true.

JetBrains ReSharper 6.1 Full Edition
Build 6.1.38.146 on 2011-12-30T21:18:32

Free evaluation not started
Plugins: none
Visual Studio 10.0.40219.1.

Copyright © 2003–2012 JetBrains s.r.o. All rights reserved.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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