[Feature Request] general warning annotations on declarations
Nobody has claimed this yet.
- Dominant language
- Mojo
- Stars
- 29.8k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Review Mojo's priorities
- I have read the roadmap and priorities and I believe this request falls within the priorities.
What is your request?
Add a general purpose annotation that allows attaching custom warnings to declarations (functions, methods, structs, traits, etc.), surfaced when the symbol is used.
This would generalize the existing @deprecated mechanism without implying removal, allowing library authors to communicate information such as experimental status or behavioral notes.
What is your motivation for this change?
A general warning annotation would improve API clarity and user experience while keeping changes without breaking.
Any other details?
@mark(status="experimental", "May change without notice")
struct Foo:
...
or
@status("experimental", "May change without notice")
struct Foo:
...
or
@warning("private", "This is intended for internal use and is not part of the public API.")
fn internalHelper():
...
Exact naming, syntax are open for discussion.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Mojo's existing @deprecated mechanism and how declaration-use warnings are surfaced. The issue is complete when an agreed general-purpose annotation design can attach custom warnings to declarations and display them when the symbol is used; naming and syntax remain open for discussion.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100