Skip to content

Proposal: out var declaration #6183

Closed
Closed
@gafter

Description

This feature would allow a variable be declared at the same time that is it passed as an out parameter:

argument-value:
    out type identifier

A variable declared this way is read-only and scoped to the enclosing statement. More specifically, the scope will be the same as for a pattern-variable introduced via pattern-matching.

You should be able to use the contextual keyword var for the variable's type, in which case the specification for overload resolution would have to be modified to account for that possibility.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions