C# 12 features: ExperimentalAttribute
Part 7 in a series on new language features in C# 12.
Experimental attribute
Mark a type, method, or assembly with the ExperimentalAttribute
and the compiler will generate a warning. You will need to explicitly suppress this warning to consume the experimental code.
[Experimental("DAVID01")]
public class ExperimentalClass
{
public void Thing()
{
//
}
}
In some ways, this feels to me like the opposite of the ObsoleteAttribute
.
Further reading
Example source
https://github.com/flcdrg/csharp-12/blob/main/07-experimental/ExperimentalClass.cs
Categories: .NET