ILSpy icon indicating copy to clipboard operation
ILSpy copied to clipboard

Type/member usage missing from analysis

Open carlreinke opened this issue 1 year ago • 2 comments

Steps to reproduce

  1. Decompile Microsoft.AspNetCore.Routing.RouteEndpointDataSource.AddRequestDelegate(...) in "Microsoft.AspNetCore.Routing, Version=8.0.0.0".
  2. In the code pane, right-click RouteEntry; click "Analyze".
  3. In the "Analyze" pane, expand "Instantiated By". The list is missing the method we just decompiled.
  4. In the code pane, right-click the property HttpMethods in the RouteEntry initializer; click "Analyze".
  5. In the "Analyze" pane, expand "set" and then "Used By". The list is missing the method we just decompiled.

Details

  • Product in use: ILSpy
  • Version in use: 8.2.0.7535

carlreinke avatar Dec 03 '23 23:12 carlreinke

Thanks for your report!

Regarding RouteEntry: The cause for this is that it is a struct and the "Instantiated By" analyzer only scans for newobj instructions, but not initobj. Not sure, if treating initobj the same would be an appropriate fix. Regarding HttpsMethods: Yes, that should actually work. Will provide a fix.

siegfriedpammer avatar Dec 04 '23 22:12 siegfriedpammer

Ideally, I'd want "Instantiated By" to include any place the decompiler would output new X. But I guess initobj represents default(X) as well as new X() for value types? I think there's an argument to be made that default for value types does represent an instantiation.

carlreinke avatar Dec 04 '23 23:12 carlreinke