Skip to content

This needs more details on the reason for the error #40067

Open
@BillWagner

Description

@BillWagner

Type of issue

Missing information

Description

The description of the error is somewhat misleading. An enumerator method can't mix yield return and return statements. A single return for an object that implements the interface is allowed.

This article should also discuss how IAsyncEnumerable<T> works for these methods as well.

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs1622

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/misc/cs1622.md

Document Version Independent Id

393a44fe-2f58-bc19-33c2-5da5504988c0

Article author

@BillWagner

Metadata

  • ID: e140b315-cdd1-3755-97cc-a6b9aa65db21
  • Service: dotnet-csharp
  • Sub-service: errors-warnings

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions