Skip to content

GetMethodMembers doesn't return correct names for generic methods #388

@jlukawska

Description

@jlukawska

When I try to find out if there are calls from the assembly code to the specific generic method, it doesn't work properly.

GetMethodMembers() method finds the method like:
System.Threading.Tasks.Task`1<System.Int32> LinqToDB.LinqExtensions::UpdateAsync(LinqToDB.Linq.IUpdatable`1<T>,System.Threading.CancellationToken)<T>

and the calls in the architecture are expected to be like:
System.Threading.Tasks.Task`1<System.Int32> LinqToDB.LinqExtensions::UpdateAsync(LinqToDB.Linq.IUpdatable`1<!!0>,System.Threading.CancellationToken)<!!0>

In the result, the method call is not found, even if the call exists.

See attached project. I've found two workarounds for this: one with use hardcoded full expected method name and one by using regular expression which is marked as deprecated.

ArchUnitNetGenericTypes.zip - there are 3 tests there and all should pass, but as you see, only the ones with mentioned workarounds pass and the one with GetMethodMembers fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions