You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Linker doesn't emit IL2026 (Warn on calls to a method with RUC) for constructors #2484
The linker doesn't warn when a method annotated with RUC is called within a constructor. Tests for this issue are dependent on a fix for issue #2446 (ExpectedWarnings not recognized on constructors).
Example:
classWarningsInCtor{[RequiresUnreferencedCode("Message for WarningsInCtor.MethodWithRUC")]staticvoidMethodWithRUC(){}//Bug: Should be produced by trimmer as well[ExpectedWarning("IL2026","Message for WarningsInCtor.MethodWithRUC",ProducedBy=ProducedBy.Analyzer)]publicWarningsInCtor(){MethodWithRUC();}//Bug: Should be produced by trimmer as well[ExpectedWarning("IL2026","Message for WarningsInCtor.MethodWithRUC",ProducedBy=ProducedBy.Analyzer)]staticWarningsInCtor(){MethodWithRUC();}}
Activity
jtschuster commentedon Jan 6, 2022
My mistake, I forgot to reference the class somewhere and it got trimmed.