Create a path from an actual nominal record and its visible stored fields:
let city = field User::address.city
let moved = city.set(user, "Recife")The root type and every segment must resolve in the current module. Fix a misspelled member, expose a permitted field, or use the correct imported type or alias. Generic fields use the actual substituted argument types.
get accepts the declared root and returns the leaf. set accepts that root
and a value of the actual leaf type, then returns a fresh root. It uses the same
stored-field and shallow-copy rules as immutable record updates. Computed
accessors and linear records cannot be silently treated as copyable fields.
A path must preserve validated-newtype construction. Root/intermediate scalar wrappers cannot be copied into new valid wrappers by replacing their inner field. An already checked newtype value may be a normal containing record's new leaf.
An Any value, annotation, cast or record with members named get/set is not
field-path evidence. Use a real field expression and retain its inferred
FieldPath<Root, Leaf> type through function parameters and return values.
The path is immutable; call its setter to update a record rather than trying
to replace its callable members.
See typed field paths.
Field paths require a complete storage proof. Unresolved type parameters and
stored functions or handlers with unproved captures are rejected, along with
linear contents. Runtime type probes and checked casts into types containing
FieldPath are unsupported: a table shape cannot prove its root/leaf interface.
Compile-time field-path execution is also unsupported. These cases produce a
diagnostic instead of manufacturing a path from an annotation or dynamic value.