-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Design Question : Should we have a special node for Out Var Declaration #18303
Comments
we need a way to represent this |
@333fred , can you come up with the API proposal here |
Some example code for context: class C1
{
public void M1()
{
M2(out var i);
}
public void M2(out int i)
{
i = 1;
}
} |
In this scenario, the underlying BoundNode for
The BoundLocal node for these declarations doesn't have anything else interesting in it that isn't already captured by the ILocalReferenceExpression. Alternatively, we could create a new class |
Design decision: We will do things as @333fred outlined. Note that we may also need to add .IsDeclaration to "IFieldReferenceExpression" (because of how scripting works). We should also test and validate that this all works for "out var" as well as deconstructions like "(var x, var y) = ..." |
The underlying |
We can either go back to syntax (as an implementation detail, not for the client to have to do). Or we can add this info to BoundFieldReference. |
Example here : #18300
The text was updated successfully, but these errors were encountered: