Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify behavior of severity #300

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading