The linker is unable to determine whether suppression is redundant when feature switches are used.
Open
- Dominant language
- C#
- Stars
- 392
- Forks
- 128
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 2
Description
```csharp
public static bool IsFeatureEnabled {
get => throw new NotImplementedException ();
}
[UnconditionalSuppressMessage ("Test", "IL2072")]
public static void Method()
{
if (IsFeatureEnabled) {
// Trigger IL2072 warning.
} else {
// Trimmer compatible code.
}
}
```
Let us assume we are using feature substitutions to set the return value of the `IsFeatureEnabled` getter to either true or false.
The linker is unable to determine whether the suppression on `Method` is redundant. Enabling the feature will make the suppression useful, disabling it makes the suppression redundant.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.