Part 7 in a series on new language features in C# 12.

C# logo

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.

public class ExperimentalClass
    public void Thing()

In some ways, this feels to me like the opposite of the ObsoleteAttribute.

Further reading

Example source