v / vlib / v2 / tests / module_mut_example / README.md
19 lines · 14 sloc · 775 bytes · 20eada7233525573d6471d2cc70fa501213e430a
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: