Skip to content

Commit 2b85787

Browse files
added content for missing error message cs8125 (#31516)
* added content for missing error message cs8125 * Update docs/csharp/language-reference/compiler-messages/cs8125.md Co-authored-by: Bill Wagner <[email protected]>
1 parent 4d8a23e commit 2b85787

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
description: "Compiler Error CS8125"
3+
title: "Compiler Error CS8125"
4+
ms.date: 9/30/2022
5+
f1_keywords:
6+
- "CS8125"
7+
helpviewer_keywords:
8+
- "CS8125"
9+
---
10+
# Compiler Error CS8125
11+
12+
Tuple element name is only allowed at position.
13+
14+
## Example
15+
16+
The following sample generates CS8125:
17+
18+
```csharp
19+
// CS8125.cs (2,15)
20+
21+
public class C
22+
{
23+
public void Method()
24+
{
25+
var tuple3 = (Item2: 2, Item1: 1);
26+
}
27+
}
28+
```
29+
30+
## To correct this error
31+
32+
If tuple element names `Item1`, `Item2`, etc. are used, ensuring the correct order corrects this error:
33+
34+
```csharp
35+
public void Method()
36+
{
37+
var tuple3 = (Item1: 2, Item2: 1);
38+
}
39+
```

docs/csharp/language-reference/compiler-messages/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,8 @@ items:
16051605
href: cs7003.md
16061606
- name: CS8124
16071607
href: cs8124.md
1608+
- name: CS8125
1609+
href: cs8125.md
16081610
- name: CS8145
16091611
href: cs8145.md
16101612
- name: CS8146

docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ f1_keywords:
296296
- "CS8121"
297297
- "CS8122"
298298
- "CS8123"
299-
- "CS8125"
300299
- "CS8126"
301300
- "CS8127"
302301
- "CS8128"

0 commit comments

Comments
 (0)