Skip to content

Trim analyzer hole for new constraint in constructor #118869

@sbomer

Description

@sbomer

Extracted from #108507

[RequiresUnreferencedCode("")]
class A;

class B<T> where T : new();

class C : B<A>
{
    public C()
    { // No warning from the analyzer!
    }
}

Note that the following example does warn:

[RequiresUnreferencedCode]
class Requires {}

class Derived : Requires
{
    public Derived // warning IL2026
    {
    }
}

Metadata

Metadata

Assignees

Labels

area-Tools-ILLink.NET linker development as well as trimming analyzers

Type

No type
No fields configured for issues without a type.

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions