Skip to content

added content for missing error message cs8141 #31510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2022
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
45 changes: 45 additions & 0 deletions docs/csharp/language-reference/compiler-messages/cs8141.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
description: "Compiler Error CS8141"
title: "Compiler Error CS8141"
ms.date: 9/30/2022
f1_keywords:
- "CS8141"
helpviewer_keywords:
- "CS8141"
---
# Compiler Error CS8141

The tuple element names in the signature of method must match the tuple element names of interface method (including on the return type).

## Example

The following sample generates CS8141:

```csharp
// CS8141.cs (10,27)
using System.Collections;

public interface IGrabber<out T>
{
T GetOne();
}

class SomeGrabber : IGrabber<(int, int)>
{
public (int a, int b) GetOne()
{
return (1, 2);
}
}
```

## To correct this error

Changing the signature of the `GetOne` method to return an unnamed tuple, matching the unnamed tuple in the interface, will correct this error:

```csharp
public (int, int) GetOne()
{
return (1, 2);
}
```
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 @@ -1619,6 +1619,8 @@ items:
href: cs0767.md
- name: cs1737
href: cs1737.md
- name: cs8141
href: cs8141.md
- name: cs8145
href: cs8146.md
- name: cs8146
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ f1_keywords:
- "CS8138"
- "CS8139"
- "CS8140"
- "CS8141"
- "CS8142"
- "CS8143"
- "CS8144"
Expand Down