Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@BillWagner

Description

@BillWagner

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

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions