Skip to content

Trim analyzer hole for new constraint in constructor #118869

Closed

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
    {
    }
}

Activity

  1. added
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Aug 18, 2025
  2. added
    area-Tools-ILLink.NET linker development as well as trimming analyzers
    and removed
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Aug 19, 2025
  3. dotnet-policy-service commented on Aug 19, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/illink
    See info in area-owners.md if you want to be subscribed.

  4. added this to the 11.0.0 milestone on Aug 19, 2025
  5. removed
    untriagedNew issue has not been triaged by the area owner
    on Aug 20, 2025
  6. self-assigned this
    on Sep 2, 2025
  7. locked and limited conversation to collaborators on Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions