What possible value (or danger) might this usage, non-usage, or abusage of System.Runtime.CompilerServices be?

46 Views Asked by At

In the legacy spaghetti, I came across this spicy meatball:

//Keep around, might prove useful.
namespace System.Runtime.CompilerServices
{
    public sealed class IsVolatile
    {
        private IsVolatile()
        {
        }
    }
}

Is this possibly of any value? Or perhaps a better question, possibly of any harm (to retain)?

1

There are 1 best solutions below

3
On BEST ANSWER

Hah - looks like you've got a situation similar to the "I want LINQ syntax, but I'm in 2.0 land", where you could "turn on" LINQ syntax via:

namespace System.Runtime.CompilerServices
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
    public class ExtensionAttribute : Attribute
    {
    }
}

Only here, you're enabling use of the volatile keyword.