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

Put OmittedType instead of null in VariableDeclaration.Type (make it non-optional again) #12588

Closed
jcouv opened this issue Jul 18, 2016 · 1 comment
Assignees
Labels
Area-Compilers Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature - Tuples Tuples Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented

Comments

@jcouv
Copy link
Member

jcouv commented Jul 18, 2016

Per compat council, we should try and avoid making a field optional that was previously mandatory.
This will decrease the chances of NullReferenceException in consuming code (such as analyzers).

@jcouv jcouv added this to the 2.0 (RC) milestone Jul 18, 2016
@jcouv jcouv self-assigned this Jul 18, 2016
@jaredpar jaredpar modified the milestones: 2.0 (RC), 2.0 (RTM) Jul 18, 2016
@jaredpar jaredpar added the Concept-API This issue involves adding, removing, clarification, or modification of an API. label Jul 19, 2016
@jaredpar jaredpar modified the milestones: 2.0 (RTM), 2.0 (RC) Jul 19, 2016
@gafter gafter self-assigned this Jul 22, 2016
@gafter
Copy link
Member

gafter commented Jul 26, 2016

We use the pattern of using OmittedTypeArgument where a type is grammatically permitted but may be omitted in some cases. The proposed use of an omitted type here represents places where a type is syntactically forbidden. That would be an error in modeling the syntax.

So the solution will be to revert VariableDeclarationSyntax to its C# 6 form and represent deconstruction as a distinct node type.

gafter added a commit to gafter/roslyn that referenced this issue Aug 3, 2016
Also update the out var syntax node to use the newly introduced
VariableComponent so it can be extended in the future to allow `out *`
or `out var (x, y)` etc without requiring any further changes to the
syntax model.
Fixes dotnet#12747, dotnet#12664, dotnet#12588, dotnet#1503
@gafter gafter added 4 - In Review A fix for the issue is submitted for review. Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 3 - Working 4 - In Review A fix for the issue is submitted for review. labels Aug 3, 2016
@gafter gafter closed this as completed Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature - Tuples Tuples Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

3 participants