-
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
Bind child expressions within bad stackalloc expression to natural type #72454
Conversation
@@ -3355,7 +3357,8 @@ public override BoundNode VisitDefaultExpression(BoundDefaultExpression node) | |||
|
|||
public override BoundNode VisitUnconvertedObjectCreationExpression(BoundUnconvertedObjectCreationExpression node) | |||
{ | |||
throw ExceptionUtilities.Unreachable(); |
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.
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.
I think the whole point is to prevent
BoundUnconvertedObjectCreationExpression
from escaping initial binding, and that is the kind of the change I would expect instead.
That makes sense, thanks. Fixed.
@@ -309,19 +309,6 @@ private int RootSlot(int slot) | |||
} | |||
} | |||
|
|||
#if DEBUG | |||
protected override void VisitRvalue(BoundExpression node, bool isKnownToBeAnLvalue = false) |
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.
Debug.Assert(node is BoundUnconvertedConditionalOperator); | ||
Debug.Assert(_returnTypesOpt is not null || _disableDiagnostics); |
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.
@@ -305,7 +305,9 @@ public CSharpOperationFactory(SemanticModel semanticModel) | |||
case BoundKind.TypeExpression: | |||
case BoundKind.TypeOrValueExpression: | |||
case BoundKind.UnconvertedCollectionExpression: | |||
|
|||
case BoundKind.UnconvertedConditionalOperator: |
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.
Given other comments for this PR, I think this change is not expected. Besides, we should not be creating NoneOperation
for language constructs that have IOperation representation (do not confuse with specific bound nodes). Effectively, NoneOperation
represents a design debt for IOperation
feature. I do not think the issue we are dealing with falls into the category. It looks like we are simply failing to properly handle an error scenario for a language construct that does have IOperation
representation. #Closed
@@ -305,7 +305,9 @@ public CSharpOperationFactory(SemanticModel semanticModel) | |||
case BoundKind.TypeExpression: | |||
case BoundKind.TypeOrValueExpression: | |||
case BoundKind.UnconvertedCollectionExpression: |
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.
Done with review pass (commit 2), tests are not looked at. |
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.
LGTM (commit 6)
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.
LGTM Thanks (iteration 6)
Fixes #72448