You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Factor code that is common to out vars after merging together.
Return type (void)
Optimize the case where LHS variable is simple ref value
tuple/ValueTuple deconstruction
Does (previous, current, next) = (current, next, null) fail due to no type on right-hand-side in which to look up Deconstruct? (no, tuples don't need Deconstruct)
Nesting case
Finding Deconstruct from base or from extension method.
Re-visit the resolution for Deconstruct, using the resolution logic from "out vars".
Verify Deconstruct is an instance method.
System.Tuple deconstruction
Move binding code to separate file.
Should deconstruction-assignment the same syntax model as deconstruction-declaration? (currently is uses a VariableDeclaration with a tuple type as the type). (answer: I don't think so)
Consider using a BadExpression in binding (answer: I don't think so as it makes the diagnostics worse)
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)
(string x,byte y,var z)=(null,1,2);// what is the type on the RHS?(string x,byte y)temp=(null,1);// the type on the right is (string, byte)
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)
Treat Deconstruct as a kind of conversion in more scenarios?
(object z5,long z6)= KVP.Create("hello",42);// You can do this (deconstruction)(object z8,long z9)z7= KVP.Create("hello",42);// You cannot do this...
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 if var 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)
This has implications on bad Deconstruct shadowing another good one (see BadDeconstructShadowsBaseDeconstruct). (confirmed, that's ok)
Can dynamic be desconstructed? (answer: no)
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();)
Reserving ‘var’, or maybe give up on ‘var (x, y) = M();’ syntax that is ambiguous with method invocation. (answer: no need)
Considering ‘@’ to simplify parsing of deconstructions. (answer: no need)
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:
Error handling/recovery
Errors in parsing
Error handling for semantic errors (e.g. ambiguous lookup, inaccessible lookup, wrong kind of thing found, instance vs static thing found, wrong type for the context, value vs variable)
Missing types (mscorlib or others)
Public interface of compiler APIs, backcompat scenarios
backward and forward compatibility (i.e. interoperation with previous and future compilers, each in both directions)
VB/F# interop, Mono issues
BCL and other customer impact
Determinism
Loading from metadata (source vs. loaded from metadata)
Atomicity
Edit-and-continue
Completeness of the specification as a guide for testing (e.g. is the spec complete enough to suggest what the compiler should do in each scenario?)
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: