Skip to content

State behavior for return statements in a using statement context #48888

@BillWagner

Description

@BillWagner

Type of issue

Missing information

Description

from anonymous feedback

While it's implied, this article should clearly state how return statements are handled in the context of a using statement or block.

It is similar to a finally block and the resource is disposed before exiting the method, but after computing any returned expression.

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/statements/using.md

Document Version Independent Id

528215d3-cbd9-2090-272c-45308087d770

Platform Id

f5fc56c7-7be7-8606-5b7d-5d5e6a4c19c5

Article author

@BillWagner

Metadata

  • ID: 45a80a02-5273-6226-5a1d-7453f350b055
  • PlatformId: f5fc56c7-7be7-8606-5b7d-5d5e6a4c19c5
  • Service: dotnet-csharp
  • Sub-service: lang-reference

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions