Reporter | Vladimir Reshetnikov (nikov) |
---|---|
Created | Apr 14, 2012 2:41:01 AM |
Updated | Apr 16, 2012 9:11:26 PM |
Priority | Normal |
Type | Bug |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Sergey Shkredov (serjic.shkredov) |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
http://www.rsdn.ru/forum/jetbrains/4694501.1.aspx
After 'Extract method':
private static bool Foo() { bool result; // selection start if (Bar() == null) return false; else result = true; // selection end return result; } private static object Bar() { return null; }
After 'Extract method':
private static bool Foo() { bool result; result = Result(); if (result == null) // Expression is always false return false; return result; } private static bool Result() { bool result; if (Bar() == null) return null; // error CS0037: Cannot convert null to 'bool' because it is a non-nullable value type else result = true; return result; // Expression is always true } private static object Bar() { return null; }