dotnet / dotnet/linker

Use reflection signature format in linker warnings

Open
#2,406 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

~~Warnings which mention ref parameters should be formatted as `Method(ref ArgType)`, not `Method(Type&)` as they currently are.~~

edit:
Let's use this issue to track the signature formatting discussed in https://github.com/dotnet/linker/pull/2461. So far we have been making a best-effort attempt to format signatures as they appear in C#, but It sounds like we would prefer for the linker warnings to use reflection notation for method signatures (and for the analyzer warnings to continue using C# signature formats.)

The reflection signature format is documented [here](https://docs.microsoft.com/en-us/dotnet/api/system.type.gettype?view=net-6.0#System_Type_GetType_System_String_) and includes things like `+` for nested classes and square brackets for generic argument lists. We need to update the linker signature formatting to match this.

Capturing some other ideas from @marek-safar in https://github.com/dotnet/linker/pull/2461#issuecomment-1000156604:
> We could explore the option of customizing the output based on the compiler used to produce the assembly but I'm really not sure it's worth it and it still has shortcomings because there are many different compilers (e.g. iron python).

> Another option would be the explicit --diagnostic csharp option but that for me would make sense if we enhanced C# compiler to produce more metadadata for illinker to easily map any metadata to C# syntax.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.