Skip to content

[Analyzer] Generate warnings for DebuggerDisplay attributes referencing RUC code #116846

Open
@MichalStrehovsky

Description

@MichalStrehovsky

ILLink generates warning for this, the analyzer should too.

We should probably share the logic that is used to parse the DebuggerDisplay string. ILLink also has some special logic to not generate a warning if it doesn't understand the string (the string could be still valid, but ILLink has a simple algorithm to parse it).

using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;

[DebuggerDisplay("{Blah}")]
class Program
{
    public string Blah
    {
        [RequiresUnreferencedCode("Nope")]
        get => "Hello";
    }

    static void Main() => Console.WriteLine("Hi");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Tools-ILLink.NET linker development as well as trimming analyzersuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions