Problem
String interpolation markers currently resolve only a single identifier. As a result, -p.name interpolates p and leaves .name as literal text, even though field selection is valid in normal expressions.
Desired behavior
Field selectors should be part of the interpolation marker:
-p.name interpolates the value of p.name.
-p.age%6d interpolates p.age using the explicit %6d format.
Scope
- Parse one or more
.field selectors after the marker root.
- Resolve them with the same dot-expression semantics used outside strings.
- Apply any explicit format to the selected value.
- Report invalid or unknown selectors as compile errors rather than partially consuming the marker.
- Specify interactions with escaped markers and undefined names.
- Add compiler and end-to-end coverage for default and explicit formatting.
- Update the formatting documentation.
This should follow PIR so interpolation expressions participate consistently in validation, dependency/range discovery, and lowering. The implementation should reuse ordinary field-access behavior rather than introduce interpolation-only lookup rules.
Problem
String interpolation markers currently resolve only a single identifier. As a result,
-p.nameinterpolatespand leaves.nameas literal text, even though field selection is valid in normal expressions.Desired behavior
Field selectors should be part of the interpolation marker:
-p.nameinterpolates the value ofp.name.-p.age%6dinterpolatesp.ageusing the explicit%6dformat.Scope
.fieldselectors after the marker root.This should follow PIR so interpolation expressions participate consistently in validation, dependency/range discovery, and lowering. The implementation should reuse ordinary field-access behavior rather than introduce interpolation-only lookup rules.