vxx2 / vlib / v2_toberemoved / tests / module_mut_example / README.md
19 lines · 14 sloc · 775 bytes · c0624b274a458fe3e487d89ae9554c2e8c25bdb6
Raw

Module Mutable Fields Example

This is a V2 fixture for pub module_mut: struct fields.

It demonstrates a field that is public for reading, but mutable only from the module that declares the struct. A separate pub mut: field is included to show the difference with a publicly mutable field.

The sources are stored as .vv2 so shared V1/vfmt paths do not parse V2-only syntax directly. To try it manually, copy the files to temporary .v files and compile them with -v2.

Expected behavior: