Repro:
// IL2026 for type (ILLink produces this twice)classClassWithWarningOnGenericArgumentConstructor_NewAndAnnotation:RequiresNewAndConstructors<ClassWithRequires>{// IL2026 (ILLink produces this twice)publicClassWithWarningOnGenericArgumentConstructor_NewAndAnnotation(){}}classRequiresNewAndConstructors<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>whereT:new();[RequiresUnreferencedCode("Message for --ClassWithRequires--")]classClassWithRequires;This produces a warning on the type and on the implicit call to the base constructor (ILLink and ILC both do this). But ILLink produces two of each. That's because:
- ILC handles the new constraint by treating it like PublicParameterlessConstructor annotations
- ILLink handles the new constraint separately, while marking generic argument types
Parent Item
Repro:
This produces a warning on the type and on the implicit call to the base constructor (ILLink and ILC both do this). But ILLink produces two of each. That's because:
Parent Item