Skip to content

List-patterns: hold Receiver directly in bound node for implicit indexer access #57855

@jcouv

Description

@jcouv

The proposal is to have the bound node for implicit indexer access holding

  • a Receiver,
  • an Argument,
  • a skipped-in-visitor LengthAccess (using placeholder for receiver),
  • and a skipped-in-visitor IndexerOrSliceAccess (using placeholders for receiver and argument(s)).

With this design the bound node maps closely to the shape of the syntax tree.

If we have this design, then NullableWalker can just visit the Receiver (and stash the result into map for the receiver placeholder), then visit the Argument, then visit the IndexerOrSliceAccess (to update the method signature with nullability).

The reason we didn't go with this design initially is because Binder.CheckValue doesn't handle placeholders well. We need to review that code and find an abstraction for all expression nodes to fulfill, including placeholders.

This work would strengthen our infrastructure to expand our use of placeholders (as opposed to storing symbols into new bound nodes) moving forward.

Metadata

Metadata

Type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions