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

[C# 12]: New Experimental Feature - Interceptors #35878

Closed
2 of 5 tasks
BillWagner opened this issue Jun 19, 2023 · 2 comments · Fixed by #36056
Closed
2 of 5 tasks

[C# 12]: New Experimental Feature - Interceptors #35878

BillWagner opened this issue Jun 19, 2023 · 2 comments · Fixed by #36056
Assignees
Labels
🏁 Release: .NET 8 Work items for the .NET 8 release doc-idea Indicates issues that are suggestions for new topics [org][type][category] dotnet-csharp/svc Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest. resolved-by-customer Indicates issues where the customer no longer needs any help. [org][resolution] whats-new/subsvc

Comments

@BillWagner
Copy link
Member

BillWagner commented Jun 19, 2023

Visual Studio release

Other (please put exact version in description textbox)

Link to speclet

Link to Pull request

New behavior

Added in 17.7, preview 3.

Because this is an experimental feature, at this time, we're only adding a note in the What's new page, and covering new compiler warnings and errors.

An interceptor is a method which can declaratively substitute a call to an interceptable method with a call to itself at compile time. This substitution occurs by having the interceptor declare the source locations of the calls that it intercepts. This provides a limited facility to change the semantics of existing code by adding new code to a compilation (e.g. in a source generator).

Areas affected

  • Add to What's new in C# 12: Add links to updated docs in the What's new in C# 12 article.
  • Update language reference: Detail the areas in the language reference that will be updated for this feature.
  • Update compiler messages: Add new (or updated) pages for new compiler messages. Include related message.
  • Include in Everyday C# section*: Is this new feature included in Everyday C#?
  • Tutorials: Are new tutorials required for this feature? If so, detail below

Language reference tasks

  • N/A for an experimental feature. We'll add more as the feature spec coalesces more.

Tutorial tasks

No response

Everyday C# tasks

No response


Associated WorkItem - 117224

@BillWagner BillWagner added Pri1 High priority, do before Pri2 and Pri3 dotnet-csharp/svc whats-new/subsvc 🏁 Release: .NET 8 Work items for the .NET 8 release labels Jun 19, 2023
@BillWagner BillWagner self-assigned this Jun 19, 2023
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Jun 19, 2023
@BillWagner BillWagner added 🗺️ reQUEST Triggers an issue to be imported into Quest. doc-idea Indicates issues that are suggestions for new topics [org][type][category] labels Jun 19, 2023
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Jun 19, 2023
@jcouv
Copy link
Member

jcouv commented Jun 19, 2023

nit: this is not technically a language feature, it is not tied to C# 12. That said, it's probably fine to bundle in the "what's new in C# 12" post. I'm not sure how we handled such features in the past.

@BillWagner
Copy link
Member Author

I'm not sure how we handled such features in the past.

Bundling this with C# 12 is similar to what I did for static abstract methods in interfaces: I added them to "what's new in C#10" as an experimental feature. Then, when the design was finalized for C# 11, I moved that feature to the "what's new in C# 11" instead. That way, customers could find it sooner, but were notified that it was an experimental feature until C# 11.

@github-actions github-actions bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Jun 21, 2023
BillWagner added a commit to BillWagner/docs that referenced this issue Jun 29, 2023
Add what's new and error / warning information for Interceptors.

Fixes dotnet#35878

This feature is experimental, so for details I'm linking to the feature spec in the roslyn repo. The feature may change. When it's finalized, I'll add more details on it in docs, and remove the warnings about its experimental status.
@ghost ghost added the in-pr This issue will be closed (fixed) by an active pull request. label Jun 29, 2023
@dotnet-bot dotnet-bot added the resolved-by-customer Indicates issues where the customer no longer needs any help. [org][resolution] label Jun 30, 2023
@ghost ghost removed the in-pr This issue will be closed (fixed) by an active pull request. label Jun 30, 2023
BillWagner added a commit that referenced this issue Jun 30, 2023
)

* Add what's new for interceptors.

* Add information on interceptors

Add what's new and error / warning information for Interceptors.

Fixes #35878

This feature is experimental, so for details I'm linking to the feature spec in the roslyn repo. The feature may change. When it's finalized, I'll add more details on it in docs, and remove the warnings about its experimental status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏁 Release: .NET 8 Work items for the .NET 8 release doc-idea Indicates issues that are suggestions for new topics [org][type][category] dotnet-csharp/svc Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest. resolved-by-customer Indicates issues where the customer no longer needs any help. [org][resolution] whats-new/subsvc
Projects
No open projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants