Skip to content
Merged
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
39 changes: 39 additions & 0 deletions docs/csharp/language-reference/compiler-messages/cs8125.md
Original file line number Diff line number Diff line change
@@ -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);
}
```
2 changes: 2 additions & 0 deletions docs/csharp/language-reference/compiler-messages/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ f1_keywords:
- "CS8121"
- "CS8122"
- "CS8123"
- "CS8125"
- "CS8126"
- "CS8127"
- "CS8128"
Expand Down