Skip to content
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

IOperation API for declaration expressions #20798

Closed
mavasani opened this issue Jul 11, 2017 · 6 comments
Closed

IOperation API for declaration expressions #20798

mavasani opened this issue Jul 11, 2017 · 6 comments
Assignees
Milestone

Comments

@mavasani
Copy link
Contributor

mavasani commented Jul 11, 2017

We need to add a separate IOperation API to represent declaration expressions, currently they get represented as ILocalReferenceExpressions. See #20749 (comment)

Examples:
M(out var x);
var (x, y) = (1, 2);

@mavasani mavasani added Area-Analyzers Bug Concept-API This issue involves adding, removing, clarification, or modification of an API. Discussion Feature - IOperation IOperation labels Jul 11, 2017
@jinujoseph
Copy link
Contributor

We think these should be exposed as their own IOperation. However, if this is difficult to do because of how the bound nodes work, then let us know. We could decide that it's just too expensive and we can settle with just having ILocalReferenceExpressions with some sort of way to map from them to the declaration expression.

@jinujoseph jinujoseph added this to the 15.5 milestone Jul 13, 2017
@jinujoseph jinujoseph removed Discussion Concept-API This issue involves adding, removing, clarification, or modification of an API. labels Jul 13, 2017
@tmat tmat modified the milestones: 15.5, 15.later Sep 6, 2017
@jinujoseph jinujoseph assigned 333fred and unassigned mavasani Sep 29, 2017
@jinujoseph jinujoseph modified the milestones: 15.later, 15.5 Sep 29, 2017
@jinujoseph
Copy link
Contributor

@333fred can you verify if we did declarationExpression ?

@333fred
Copy link
Member

333fred commented Sep 29, 2017

We settled on IsDeclaration on ILocalReferenceExpression and IFieldReferenceExpression. https://github.com/dotnet/roslyn/blob/master/src/Compilers/Core/Portable/Operations/ILocalReferenceExpression.cs#L21-L25

@333fred 333fred closed this as completed Sep 29, 2017
@333fred
Copy link
Member

333fred commented Sep 29, 2017

Dupe of #18303.

@jinujoseph
Copy link
Contributor

how about tuples var (x, y) = (1, 2); scenario ?

@333fred
Copy link
Member

333fred commented Sep 29, 2017

That was one of the tests I added.

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

No branches or pull requests

4 participants