Skip to content

Mark experimental API with .NET's [Experimental] attribute #2120

Description

@Rafael-SOWNet

amcli mcp marks a preliminary tool where a model reads it (#2113). The library's experimental API has nothing like it: MathS.ExperimentalFeatures says so in its name and its doc comment, and a caller's build never mentions it.

.NET has a marker for this, [Experimental("<id>")] in System.Diagnostics.CodeAnalysis. Measured with SDK 10.0.302, a member marked [Experimental("AM0001")] gives:

caller result
C#, net10.0 error AM0001: "… is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed."
C#, netstandard2.0, with the attribute defined internally in the library's netstandard2.0 build the same error
F#, net10.0 warning FS0057, "This construct is experimental"; the build succeeds

A C# caller opts in with #pragma warning disable AM0001 or <NoWarn>.

Questions:

  1. Should experimental API carry [Experimental], starting with PiecewiseOver before 2.7.0 ships?
  2. One diagnostic ID for all of it, or one per feature, so that opting into one doesn't opt into the rest?

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Opinions wantedWe are interested in your opinion about the topic

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions