History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-28125
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Olga Lobacheva
Reporter: Vladimir Reshetnikov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
ReSharper

'Intoduce variable' incorrectly detects type of variable if it is nullable

Created: 21 Aug 06 14:48   Updated: 30 May 08 18:44
Component/s: Refactorings - Introduce Variable
Fix Version/s: 4.0
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 258
Fixed in build: 812


 Description  « Hide
using System;
class Stuff
{
public void Foo(Nullable<bool> flag)
{
if(flag == null) { }
}
}

Select 'null' and apply 'Introduce variable'

using System;
class Stuff
{
public void Foo(Nullable<bool> flag)
{
object Null = null;
if (flag == Null) { } /* error CS0019: Operator '==' cannot be applied to operands of type 'bool?' and 'object' */
}
}

Expected result:

using System;
class Stuff
{
public void Foo(Nullable<bool> flag)
{
Nullable<bool> Null = null;
if (flag == Null) { }
}
}



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.