rspec/rules/S4022/rule.adoc

36 lines
582 B
Plaintext
Raw Normal View History

2020-12-23 14:59:06 +01:00
By default the storage type of an ``enum`` is ``Int32``. In most cases it is not necessary to change this. In particular you will not achieve any performance gain by using a smaller data type (e.g. ``Byte``) and may limit future uses.
2020-06-30 12:49:37 +02:00
== Noncompliant Code Example
----
using System;
namespace MyLibrary
{
public enum Visibility : sbyte // Noncompliant
{
Visible = 0,
Invisible = 1,
}
}
----
== Compliant Solution
----
using System;
namespace MyLibrary
{
public enum Visibility
{
Visible = 0,
Invisible = 1,
}
}
----