Priority
Show-stopper
Type
Bug 
State
Fixed 
Assignee
Dmitry Lomov 
Subsystem
No subsystem 
Affected versions
Fixed in
Fixed in build
Next build 
Build
517
  • Submitted by   Andrew Serebryansky
    2 years ago (07 Sep 2007 12:44)
  • Updated by Andrew Serebryansky
    2 years ago (29 Oct 2007 19:45)
  • Jira: RSRP-48806
    (history, comments)

RSRP-48806

ReSharper resolves symbol to a class while C# compiler resolves that symbol to property

0
While formatting the following code with 'Shorten qualified references' option turned on:

using System.Collections.Generic;

namespace CreatureComfort.Library
{
public class Visit
{
public static List<Visit> CreateSortedListOfAllVisits()
{
return null;
}
}
}

namespace CreatureComfort.WebSite.Visit
{
class EntitySetup
{
public Library.Visit Visit { get { return null; } }

public static Library.Visit FindVisit( )
{
List<Library.Visit> visits = CreatureComfort.Library.Visit.CreateSortedListOfAllVisits();
return visits[0];
}
}
}

ReSharper produces the following code:

using System.Collections.Generic;
using CreatureComfort.Library;

namespace CreatureComfort.Library
{
public class Visit
{
public static List<Visit> CreateSortedListOfAllVisits()
{
return null;
}
}
}

namespace CreatureComfort.WebSite.Visit
{
internal class EntitySetup
{
public Library.Visit Visit
{
get { return null; }
}

public static Library.Visit FindVisit()
{
List<Library.Visit> visits = Visit.CreateSortedListOfAllVisits();
return visits[0];
}
}
}

which is not compilable since 'Visit' is resolved to the property 'Visit' by the compiler, while ReSharper resolves it to the class 'Visit'

Issue was closed
Comments (0)
 
History (0)
 
Links
 
Issue has no comments