-
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
[Umbrella] Deconstruction work items #11299
Comments
This was referenced May 18, 2016
This was referenced May 26, 2016
This was referenced Jun 28, 2016
This was referenced Jul 11, 2016
This was referenced Sep 15, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This list is no longer maintained. Remaining work items and issues are tracked as issues with label "Tuples".
This is the TODO list for the development of the deconstruction language feature for C# 7.
Known issues and scenarios
Spec deconstructions (talk to Mads about "deconstruction conversion" in the current implementation)
Discard support Support discards in deconstructions, out var and patterns #12619
Deconstruction-declarations in expression context Allow parsing deconstruction-declaration as expression #15049
Deconstructions with mix of assignment and declaration Allow mixed deconstructions, with both assignments and declarations #15050
Adding Deconstruct on some BCL types (issue was abandoned)
Update spec (here's the branch to work on)
Deconstruction-assignment
(.... ) = async Expr();
(previous, current, next) = (current, next, null)
fail due to no type on right-hand-side in which to look upDeconstruct
? (no, tuples don't need Deconstruct)Deconstruct
from base or from extension method.Deconstruction-declaration
VariableDeclaration.Type
(make it non-optional again). Put OmittedType instead of null in VariableDeclaration.Type (make it non-optional again) #12588var (int x, string y = null) = M();
using
).(x, (y, z)) => ...
M(out var (x, y))
(Type1 x, Type2 x) = foo;
(int x, int y) = x;
// flow analysisvar
should give an error.var (x, y) = ...
syntax.Write spec
Resolve filed issues
LDM
D-assignment return type: could we make use of the return-type of Deconstruct method?
D-declaration with typeless tuple literals. (answer: let's make it work. LDM 7/13)
What is the return type of a deconstruction-assignment expression? Void or some tuple? (answer: currently void, but if we have time let's do smart tuple return. LDM 7/13)
I assume no compound assignment
(x, y) += M();
(answer: not at this point. LDM 7/13)Wildcard? (answer: yes, should probably be star. LDM 7/13)
Should anonymous types have a Deconstruct? (answer: no, low value. LDM 7/13)
Should names matter in deconstruction? (answer: yes, let's warn tuple literal
var (x, y) = (a: 1, x: 2);
)Confirm that
var (x, y) = ...
should be an error ifvar
type exists. (answer: correct)Confirm that
var (x, y) = ...
is a deconstruction even when a ref-returning "var" method exists. (answer: correct)FYI the Deconstruct method is now resolved like an invocation with out vars. (confirmed, yes)
BadDeconstructShadowsBaseDeconstruct
). (confirmed, that's ok)What contexts are deconstruction-declarations allowed in? (answer: LDM confirmed the prioritization above)
Is
(int x, var (y, z)) = M();
allowed? (answer: yes)I assume no mix of assignment and declaration
int x; (x, int y) = M();
(answer: confirmed in 5/25 LDM)I assume deconstruction-assignment should work even if System.ValueTuple is not present. (answer: that is no longer the case, ValueTuple is required)
Switching to tuple-returning-Deconstruct? (answer: no)
What is the evaluation order for nested deconstruction-assignment? (answer: all LHS side-effects, all RHS, all conversions, all assignments)
Finalize syntax for deconstruction-declaration. (answer:
var (x, y) = M();
and(int x, int y) = M();
)Do the names matter?
int x, y; (a: x, b: y) = M();
(answer: for now this should be error)Interaction with other language features:
General concerns:
Types and members:
Code:
Misc:
Interaction with Debugger:
Interaction with IDE:
References
#10642
The text was updated successfully, but these errors were encountered: