You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The page for the when contextual keyword doesn’t mention which C# language versions support this feature.
Why it matters
Knowing the minimum language version helps developers decide whether they can use when in their target environment and avoid compiler‑version surprises.
Suggested fix
Add an “Introduced in” note—e.g., exception‑filter usage in C# 6.0 and pattern‑matching usage in C# 7.0.
Include a quick table or note under Version compatibility (similar to other keyword pages).
I did try an experiment with this some time ago. Adding version notes causes more issues than it fixes. In many articles, it requires multiple notes on which aspects of a features were introduced in which version. Example include pattern matching (is, switch expressions, and, or and not in patterns, list patterns, etc).
As a compromise, we've done two things with the C# docs:
Any feature added in the last 3 GA versions is noted. Currently, that's anything added in C# 13, 12, and 11 (in addition to any preview features coming in C# 14).
The C# version history article lists the features added in each version. That serves as the full roadmap. That article does list exception filters, which were added in C# 6 (almost 10 years ago).
For those reasons, I'll close this without action.
Type of issue
Missing information
Description
Describe the gap
The page for the when contextual keyword doesn’t mention which C# language versions support this feature.
Why it matters
Knowing the minimum language version helps developers decide whether they can use when in their target environment and avoid compiler‑version surprises.
Suggested fix
Add an “Introduced in” note—e.g., exception‑filter usage in C# 6.0 and pattern‑matching usage in C# 7.0.
Include a quick table or note under Version compatibility (similar to other keyword pages).
Thanks for keeping the docs ship‑shape!
Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/when#when-in-a-catch-clause
Content source URL
https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/keywords/when.md
Document Version Independent Id
15502bbc-5355-2add-0fa8-ae31dc01c122
Platform Id
fc890810-32dd-4d12-8d92-381651ec6eed
Article author
@BillWagner
Metadata
Related Issues
The text was updated successfully, but these errors were encountered: