-
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
Hold Receiver directly in bound node for implicit indexer access #58009
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,7 @@ | |
<Node Name="BoundImplicitIndexerReceiverPlaceholder" Base="BoundValuePlaceholderBase"> | ||
<Field Name="Type" Type="TypeSymbol" Override="true" Null="disallow"/> | ||
<Field Name="ValEscape" Type="uint" Null="NotApplicable"/> | ||
<Field Name="IsEquivalentToThisReference" Type="bool" PropertyOverrides="true"/> | ||
</Node> | ||
|
||
<!-- This node represents the receiver for a list pattern. It does not survive lowering --> | ||
|
@@ -2069,21 +2070,21 @@ | |
<Node Name="BoundImplicitIndexerAccess" Base="BoundExpression" SkipInNullabilityRewriter="true" HasValidate="true"> | ||
<Field Name="Type" Type="TypeSymbol" Override="true" Null="disallow" /> | ||
|
||
<!-- The target of the index operation --> | ||
<Field Name="Receiver" Type="BoundExpression" Null="disallow" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm very glad we're able to move back to this design with the confidence that the ValueCheck logic only needs to be abstracted for placeholders that might be "this" (not as bad as we feared). |
||
|
||
<!-- An expression with type Index or Range --> | ||
<Field Name="Argument" Type="BoundExpression" Null="disallow" /> | ||
|
||
<Field Name="LengthOrCountAccess" Type="BoundExpression" SkipInVisitor="true" /> | ||
|
||
<!-- The receiver placeholder for length access --> | ||
<!-- The receiver placeholder for length access and IndexerOrSliceAccess--> | ||
<Field Name="ReceiverPlaceholder" Type="BoundImplicitIndexerReceiverPlaceholder" SkipInVisitor="true" /> | ||
|
||
<!-- | ||
May be BoundIndexerAccess or BoundCall or BoundArrayAccess, | ||
which are built using the real receiver (not a placeholder) and placeholder(s) for argument(s). | ||
We don't mark this property as SkipInVisitor="true" because it contains real receiver, but we | ||
make sure SemanticModel doesn't dig too deep into the node. | ||
May be BoundIndexerAccess or BoundCall or BoundArrayAccess | ||
--> | ||
<Field Name="IndexerOrSliceAccess" Type="BoundExpression" Null="disallow" /> | ||
<Field Name="IndexerOrSliceAccess" Type="BoundExpression" Null="disallow" SkipInVisitor="true" /> | ||
|
||
<!-- The receiver placeholder(s) of type Int32 for indexer access (one if implicit Index indexer, two if implicit Range indexer) --> | ||
<Field Name="ArgumentPlaceholders" Type="ImmutableArray<BoundImplicitIndexerValuePlaceholder>" Null="disallow" SkipInVisitor="true" /> | ||
|
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.
nit: I found the comment confusing. If the behavior is incorrect, should we file an issue instead?
Same for BoundAwaitableValuePlaceholder
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 is not something that I intend to pursue, given that this only affects warnings. If you think we have to follow up anyway, I can open an issue. Let me know.