Skip to content

[Version 9.0] Feature support for attributes on local functions#1466

Open
BillWagner wants to merge 13 commits into
draft-v9from
v9-attribute-locations
Open

[Version 9.0] Feature support for attributes on local functions#1466
BillWagner wants to merge 13 commits into
draft-v9from
v9-attribute-locations

Conversation

@BillWagner

@BillWagner BillWagner commented Nov 11, 2025

Copy link
Copy Markdown
Member

Update the C# standard for the feature of applying attributes on local functions.

Note that this also includes specifying extern on a static local function.

This contains all commits from #994. Subsequent edits also made.

Comment thread standard/statements.md Outdated
@BillWagner
BillWagner force-pushed the v9-attribute-locations branch from e32a191 to 4184054 Compare November 11, 2025 20:15
@RexJaeschke RexJaeschke added this to the C# 9.0 milestone Nov 12, 2025
@RexJaeschke RexJaeschke added type: feature This issue describes a new feature Review: pending Proposal is available for review labels Nov 12, 2025
@BillWagner BillWagner self-assigned this Dec 2, 2025
@BillWagner
BillWagner force-pushed the v9-attribute-locations branch from 0fc9ff9 to 8b61c71 Compare January 6, 2026 18:20
@BillWagner
BillWagner marked this pull request as ready for review January 6, 2026 18:23
@BillWagner BillWagner added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Jan 6, 2026
@BillWagner

Copy link
Copy Markdown
Member Author

I reviewed the existing edits, made a couple small wording changes.

This is ready for committee review for V9.

Comment thread standard/attributes.md Outdated
Comment thread standard/attributes.md Outdated
Comment thread standard/attributes.md Outdated
Comment thread standard/attributes.md Outdated
Comment thread standard/attributes.md Outdated
@BillWagner

Copy link
Copy Markdown
Member Author

@jskeet I've addressed all open comments on this one.

It is small, and Joseph approved. I'd like to put this on the next agenda for possibly merging it.

@jskeet jskeet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks ready to go.

Comment thread standard/attributes.md Outdated
Comment thread standard/variables.md Outdated
@BillWagner BillWagner removed the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Mar 11, 2026
@BillWagner
BillWagner force-pushed the v9-attribute-locations branch from ab0c7b8 to 9039bb8 Compare April 10, 2026 20:45
BillWagner added a commit that referenced this pull request Apr 10, 2026
@BillWagner
BillWagner force-pushed the v9-attribute-locations branch from 9039bb8 to 641fcc6 Compare May 12, 2026 21:10
Add support for attributes and extern on local functions

fix md formatting
@BillWagner
BillWagner force-pushed the v9-attribute-locations branch from 641fcc6 to bc9ef6c Compare June 24, 2026 17:40
@BillWagner

Copy link
Copy Markdown
Member Author

An earlier version of this feature is already present on alpha-v9 from a prior meeting. Edits made to this PR since then are not yet on alpha-v9; they will land at the next propagation. If you need them on alpha-v9 sooner, please open a separate PR targeting alpha-v9.
Thanks!

@BillWagner BillWagner added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Jun 29, 2026
@BillWagner

Copy link
Copy Markdown
Member Author

@jskeet If we finish the C# 8 work in time, this should be ready to merge for C# 9.

Comment thread standard/attributes.md

> *Example*: Consider the following:
>
> <!-- Example: {template:"standalone-console", name:"CallerMemberName1", inferOutput:true} -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we easily extend the example to include a lambda? Presumably this would do the trick, if we've got Action declared elsewhere:

Action anonymousFunction = () => F2();
anonymousFunction();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in the next commit.

addresses #1466 (review)

extend the example to include a lambda expression expansion.
@BillWagner

Copy link
Copy Markdown
Member Author

@jskeet If you're happy with the updated sample, this should be ready to go.

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

Labels

meeting: discuss This issue should be discussed at the next TC49-TG2 meeting Review: pending Proposal is available for review type: feature This issue describes a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants