diff --git a/docs/csharp/programming-guide/classes-and-structs/local-functions.md b/docs/csharp/programming-guide/classes-and-structs/local-functions.md index d8571d6778b11..758cb893eeb8c 100644 --- a/docs/csharp/programming-guide/classes-and-structs/local-functions.md +++ b/docs/csharp/programming-guide/classes-and-structs/local-functions.md @@ -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] diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md index 52927bcffba90..329cff11c0d54 100644 --- a/docs/csharp/whats-new/csharp-version-history.md +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -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)