-
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
Handling remaining PROTOTYPE markers in features/tuples branch #12411
Conversation
@@ -56,14 +56,23 @@ private BoundDeconstructionAssignmentOperator BindDeconstructionAssignment(CShar | |||
|
|||
if ((object)boundRHS.Type == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we distinguish between the case:
- RHS is
(null, null)
and hence has no type - RHS is in error and hence has no type.
In the latter case I assume we wouldn't want to go down this code path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When RHS is in error, its type is ErrorType
(not null) which is already handled below (by DeconstructIntoStep
). Added a test explicitly for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a good rule for when errors will cause Type
to be ErrorType
and when it will be null
? Having both without a justification for when to choose one or the other make it harder to review code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I haven't heard any. So far, the cases I encountered where Type
was null is in the expression null
and also typeless tuples (() => {}, null)
.
I filed issue #12428 and will follow-up on that question separately.
@dotnet/roslyn-compiler Please review. I want to merge the deconstruction feature back into the master branch before lunch. |
LGTM |
Filed the following issues:
I spent some time today trying to come up with a better solution for the last one, but after discussion with Vlad, I prefer to unblock the merge back to master and resolve the difficult language questions later. For now, I report errors if you try to use typeless tuple literals in a d-declaration (which is better than previous crashing behavior).
@dotnet/roslyn-compiler for review.
Related to #11299