Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ helpviewer_keywords:
- Finalizers
- Other local functions

Beginning with C# 8.0, local function parameters can shadow local variables and parameters from an enclosing scope.

However, local functions can't be declared inside an expression-bodied member.

> [!NOTE]
Expand Down
1 change: 1 addition & 0 deletions docs/csharp/whats-new/csharp-version-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ C# 8.0 is the first major C# release that specifically targets .NET Core. Some f
- Positional patterns
- [Using declarations](../language-reference/statements/using.md)
- [Static local functions](../programming-guide/classes-and-structs/local-functions.md)
- Lambda expressions, anonymous methods, and local functions can declare parameters that shadow local variables and parameters from an enclosing scope.
- [Disposable ref structs](../language-reference/builtin-types/ref-struct.md)
- [Nullable reference types](../language-reference/builtin-types/nullable-reference-types.md)
- [Asynchronous streams](../language-reference/statements/iteration-statements.md#await-foreach)
Expand Down
Loading