Skip to content

Commit

Permalink
Merge pull request #300 from terrajobst/update-experimental-attribute
Browse files Browse the repository at this point in the history
Clarify behavior of severity
  • Loading branch information
terrajobst authored Sep 26, 2023
2 parents 96d2dda + 17cc878 commit a215ebc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion accepted/2023/preview-apis/preview-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,14 @@ both options are being presented to the consumer.

### Compiler Behavior

*For more details on the compiler behavior, see [C# spec][csharp-spec].*

The compiler will raise a diagnostic when an experimental API is used, using the
supplied diagnostic ID. The severity is always error.
supplied diagnostic ID.

> [!NOTE]
> The severity is warning, because errors cannot be suppressed. However, the
> warning is promoted to an error for purpose of reporting.
The semantics are identical to how obsolete is tracked, except there is no
special treatment when both caller and callee are in the same assembly -- any
Expand Down Expand Up @@ -254,6 +260,7 @@ the usual means (i.e. `#pragma` or project-wide `NoWarn`).
- We should point users to this new attribute (`ExperimentalAttribute`)

[preview-features]: ../../2021/preview-features/preview-features.md
[csharp-spec]: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-12.0/experimental-attribute.md

## Q & A

Expand Down

0 comments on commit a215ebc

Please sign in to comment.