-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
area-Tools-ILLink.NET linker development as well as trimming analyzers.NET linker development as well as trimming analyzers
Milestone
Description
Similar to #107660, it should be possible to call static methods on a derived type even if the type declaration has mismatching DAM annotations. The problem should surface when the base type is actually instantiated:
using System.Diagnostics.CodeAnalysis;
Derived<int>.DoSomethingSafe();
new Derived<int>();
class Derived<T> : Base<T> // warns here but should not
{
public Derived() // warns here
{
}
public static void DoSomethingSafe() { }
}
class Base<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] T>
{
static void Require() => typeof(T).GetMethods();
}
Similar for interfaces.
@MichalStrehovsky @agocke do you agree or can you see any problems with this?
Metadata
Metadata
Assignees
Labels
area-Tools-ILLink.NET linker development as well as trimming analyzers.NET linker development as well as trimming analyzers
Type
Projects
Status
No status