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

Key: RSRP-44794
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Ilya Ryzhenkov
Reporter: Dmitry Shaporenkov
Votes: 0
Watchers: 0
Operations

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

Find Dependent code shows redundant usages like fields whose types are related to the module

Created: 03 Jul 07 18:07   Updated: 05 Jul 07 15:44
Component/s: Code View - Search
Fix Version/s: Future Versions
Security Level: Everybody (All jira users)

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

Build: 471


 Description  « Hide
Say I have a simplest WinApp project in VB that references System.Xml assembly. I've written the following code in the only file in the project:
Public Class HasXmlNodeImpl
    Implements IHasXmlNode


    Public Function GetNode() As XmlNode Implements IHasXmlNode.GetNode
        Return Nothing
    End Function
End Class

Public Class Test

    Private myIHasXmlNode As HasXmlNodeImpl


    Public Sub New()
        Console.WriteLine(myIHasXmlNode)
    End Sub

End Class

I run Find Dependent Code on System.XML. What I get is below:

Search target
  System.Xml in project <WindowsApplication1>
Found 6 usages in project WindowsApplication1
  WindowsApplication1 (4 items)
    HasXmlNodeImpl (2 items)
      GetNode() As XmlNode (1 item)
        (8,34) Public Function GetNode() As XmlNode Implements IHasXmlNode.GetNode
      (5,16) Implements IHasXmlNode
    Test (2 items)
      New() (1 item)
        (21,27) Console.WriteLine(myIHasXmlNode)
      (16,30) Private myIHasXmlNode As HasXmlNodeImpl

The problem is, it shows me the usages like 'Console.WriteLine(myIHasXmlNode)' in the constructor. I don't think this is the usage of the 'System.Xml' assembly - the fact that the type of the field 'myIHasXmlNode' has something to do with 'System.Xml', doesn't yet mean that any usage of 'myIHasXmlNode' is a usage of System.Xml. Such usages shouldn't be shown in the results.



 All   Comments   Work Log   Change History      Sort Order:
Ilya Ryzhenkov - 03 Jul 07 19:37
What if you have
myField1.Method1(myField2.Method2());

where result of myField2.Method2() is of type from module in question, as well as parameter of myField1.Method1(). However, we don't have any reference here, which resolves into symbol from module...