Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dynamic Access

The dynamic access postfix operation accesses a named field within a structure.

Process

At runtime:

  1. the operand is evaluated; and
  2. the provided identifier is resolved as a member of the operand; and
  3. the result is the resolved member.

Enumeration variant payloads are not accessed dynamically; they are extracted by match expressions.

Assertions

  1. The operand is of a structure type.
  2. The accessed name is a field declared by that structure type.

Syntax

dynamic_access_operation = dot, identifier ;