|
|
|
|
|
by amedvednikov
1461 days ago
|
|
V has global consts, they are immutable, but can be initialized with complex expressions, for example `const x = foo()` There's a bug that allows to trick the compiler and modify the const via another variable, it's a one line fix, and will be fixed today. Global mutable variables are only allowed with `-enable-globals` and are supposed to be used only in low level code, like drivers and kernels. |
|
What does the intended behaviour (after the fix) look like? Are mutable fields in structs disallowed if the struct is pointed to by a const?