diff --git a/docs/csharp/language-reference/compiler-messages/cs8125.md b/docs/csharp/language-reference/compiler-messages/cs8125.md new file mode 100644 index 0000000000000..6d7a2a7cb44c6 --- /dev/null +++ b/docs/csharp/language-reference/compiler-messages/cs8125.md @@ -0,0 +1,39 @@ +--- +description: "Compiler Error CS8125" +title: "Compiler Error CS8125" +ms.date: 9/30/2022 +f1_keywords: + - "CS8125" +helpviewer_keywords: + - "CS8125" +--- +# Compiler Error CS8125 + +Tuple element name is only allowed at position. + +## Example + + The following sample generates CS8125: + +```csharp +// CS8125.cs (2,15) + +public class C +{ + public void Method() + { + var tuple3 = (Item2: 2, Item1: 1); + } +} +``` + +## To correct this error + +If tuple element names `Item1`, `Item2`, etc. are used, ensuring the correct order corrects this error: + +```csharp + public void Method() + { + var tuple3 = (Item1: 2, Item2: 1); + } +``` diff --git a/docs/csharp/language-reference/compiler-messages/toc.yml b/docs/csharp/language-reference/compiler-messages/toc.yml index 7ae7e1800c883..ff5c5cbcc56ba 100644 --- a/docs/csharp/language-reference/compiler-messages/toc.yml +++ b/docs/csharp/language-reference/compiler-messages/toc.yml @@ -1605,6 +1605,8 @@ items: href: cs7003.md - name: CS8124 href: cs8124.md + - name: CS8125 + href: cs8125.md - name: CS8145 href: cs8145.md - name: CS8146 diff --git a/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md b/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md index 6549e93014709..9f2e1ab220ab8 100644 --- a/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md +++ b/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md @@ -296,7 +296,6 @@ f1_keywords: - "CS8121" - "CS8122" - "CS8123" - - "CS8125" - "CS8126" - "CS8127" - "CS8128"