Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use reflection signature format in linker warnings #2406

Open
sbomer opened this issue Nov 29, 2021 · 1 comment
Open

Use reflection signature format in linker warnings #2406

sbomer opened this issue Nov 29, 2021 · 1 comment

Comments

@sbomer
Copy link
Member

sbomer commented Nov 29, 2021

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 #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 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 #2461 (comment):

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.

@sbomer sbomer changed the title Fix linker's formatting of ref/out parameters Use reflection signature format in linker warnings Jan 3, 2022
@jtschuster
Copy link
Member

I don't think there's a reflection notation standard for the delimiters between type names and members, so we need to decide what we want to do for that. When we were following C# notation we used ., but that is already used in reflection notation as namespace delimiters only. To avoid making our own version of reflection notation we could use a format like member "Method" from type "TopNamespace.SubNameSpace.ContainingClass+NestedClass,MyAssembly". Otherwise, I believe IL uses Type::Method, which is not used in reflection notation, so I think that would make the most sense if we want a single path for members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants