diff --git a/proposals/csharp-12.0/experimental-attribute.md b/proposals/csharp-12.0/experimental-attribute.md index a596ee17dc..06f8b436bd 100644 --- a/proposals/csharp-12.0/experimental-attribute.md +++ b/proposals/csharp-12.0/experimental-attribute.md @@ -29,23 +29,30 @@ namespace System.Diagnostics.CodeAnalysis } ``` -## Warnings -The warning message is a specific message, where `'{0}'` is the fully-qualified type or member name. -``` -'{0}' is for evaluation purposes only and is subject to change or removal in future updates. -``` +## Reported diagnostic -The warning is reported for any reference to a type or member that is either: +Although the diagnostic is technically a warning (so that the compiler allows suppressing it), +it is treated as an error for purpose of reporting. This causes the build to fail if the diagnostic +is not suppressed. + +The diagnostic is reported for any reference to a type or member that is either: - marked with the attribute, - in an assembly or module marked with the attribute, except when the reference occurs within `[Experimental]` members (automatic suppression). -It is also possible to suppress the warning by usual means, such as an explicit compiler option or `#pragma`. +It is also possible to suppress the diagnostic by usual means, such as an explicit compiler option or `#pragma`. +For example, if the API is marked with `[Experimental("DiagID")]` or `[Experimental("DiagID", UrlFormat = "https://example.org/{0}")]`, +the diagnostic can be suppressed with `#pragma warning disable DiagID`. -The attribute is not inherited from base types or overridden members. +An error is produced if the diagnostic ID given to the experimental attribute is not a [valid C# identifier](https://github.com/dotnet/csharpstandard/blob/standard-v7/standard/lexical-structure.md#643-identifiers). -The warning is promoted to an error for purpose of reporting. +The diagnostic message is a specific message, where `'{0}'` is the fully-qualified type or member name. +``` +'{0}' is for evaluation purposes only and is subject to change or removal in future updates. +``` + +The attribute is not inherited from base types or overridden members. ## ObsoleteAttribute and DeprecatedAttribute