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

Support discards in deconstructions, out var and patterns #12619

Closed
jcouv opened this issue Jul 19, 2016 · 8 comments
Closed

Support discards in deconstructions, out var and patterns #12619

jcouv opened this issue Jul 19, 2016 · 8 comments
Assignees
Labels
Area-Compilers New Language Feature - Tuples Tuples Resolution-Duplicate The described behavior is tracked in another issue
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented Jul 19, 2016

(int i, int j, *) = M();
var (i, j, *) = M();

Even if wildcards don't make it into C# 7, we need to figure out the syntax model and design, so they can be added smoothly later.

@jcouv jcouv added this to the 2.0 (RC) milestone Jul 19, 2016
@jcouv jcouv self-assigned this Jul 19, 2016
@HaloFour
Copy link

Has the wildcard syntax been settled? My vote is definitely for * (rather than trying to make _ do double duty contextually).

@jcouv
Copy link
Member Author

jcouv commented Jul 20, 2016

@HaloFour The syntax is not finalized yet, but * has some advantages as it is not ambiguous with any identifier. We're leaning that way at the moment.

@jcouv
Copy link
Member Author

jcouv commented Jul 21, 2016

@HaloFour One more thing to set expectations, it is possible that wildcards may not make it in C# 7, but only 7.1 or 8, due to time constraint. I intend to figure out the design so that it can be added later without introducing compat issues.

@jaredpar
Copy link
Member

Moving the actual language feature out to 2.1 for now. Issue #12664 is tracking the syntax work in RC.

@jaredpar jaredpar modified the milestones: 2.1, 2.0 (RC) Jul 21, 2016
@jcouv jcouv changed the title Support wildcards in deconstructions Support wildcards in deconstructions and out vars Aug 25, 2016
@jcouv jcouv changed the title Support wildcards in deconstructions and out vars Support wildcards in deconstructions Aug 25, 2016
@jcouv jcouv removed the New Language Feature - Out Variable Declaration Out Variable Declaration label Aug 25, 2016
@gafter
Copy link
Member

gafter commented Sep 19, 2016

This will be easier to address once #13270 has been done.

@jcouv
Copy link
Member Author

jcouv commented Sep 19, 2016

This will be easier to address once #13270 has been done.

@gafter I didn't understand that comment. The way I'd implement wildcards in the current design would be make a special DeconstructionVariable for wildcard and not produce the final assignment step to such a variable.
We'd still produce conversion steps (since they are observable) as normal.

@gafter
Copy link
Member

gafter commented Sep 20, 2016

@jcouv The initial binder should not be producing any "steps" at all, as those are not part of the static semantics of the construct.

@jcouv jcouv changed the title Support wildcards in deconstructions Support discards in deconstructions Nov 16, 2016
@jcouv jcouv modified the milestones: 2.0 (RC.2), 2.1 Nov 16, 2016
@jcouv jcouv changed the title Support discards in deconstructions Support discards in deconstructions and out var Nov 16, 2016
@jcouv jcouv changed the title Support discards in deconstructions and out var Support discards in deconstructions, out var and patterns Nov 16, 2016
@jcouv
Copy link
Member Author

jcouv commented Nov 16, 2016

This issue was superseded by the more detailed issue #14794

@jcouv jcouv closed this as completed Nov 16, 2016
@jcouv jcouv added Resolution-Duplicate The described behavior is tracked in another issue and removed 3 - Working labels Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers New Language Feature - Tuples Tuples Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

4 participants