Skip to main content

RCS1096: Use 'HasFlag' method or bitwise operator

Properties

PropertyValue
Default Severitydisabled by default
Minimum language version-

Examples

Example #1

diagnostic.cs
options.HasFlag(RegexOptions.IgnoreCase)
fix.cs
(options & RegexOptions.IgnoreCase) != 0

Configuration

info

Option roslynator_enum_has_flag_style is required to be set for this analyzer to work.

.editorconfig
# Use 'HasFlag' method or bitwise operator
roslynator_enum_has_flag_style = method|operator

Applies to