AsmResolver
AsmResolver copied to clipboard
Method analyzer doesn't locate override implementations when layered
Describe the bug
Using feature/workspaces DotNetWorkspace to analyze an abstract method should find all of the direct implementations, but only looks for types that implement the abstract method's declaring type.
To Reproduce
using System;
using System.Linq;
using AsmResolver.DotNet;
using AsmResolver.Workspaces.DotNet;
var path = "Issue.dll";
var module = ModuleDefinition.FromFile(path);
var workspace = new DotNetWorkspace();
workspace.Assemblies.Add(module.Assembly);
workspace.Analyze();
var type = module.TopLevelTypes.First(d=>d.Name == "TestAbstractClass");
var method = type.Methods.First(d => d.Name == "TestAbstractBool");
var node = workspace.Index.GetOrCreateNode(method);
var impls = node.BackwardRelations.GetObjects(DotNetRelations.ImplementationMethod).ToArray();
foreach (var impl in impls)
{
Console.WriteLine(impl.DeclaringType.Name);
}
Console.WriteLine(impls.Length == 3);
Proposal
Should perhaps look recursively for the types that implement the abstract method's declaring type
Screenshots

Platform
- OS: Linux
- AsmResolver Version: feature/workspaces branch