mirror of
https://github.com/vlang/v.git
synced 2025-09-15 15:32:27 +03:00
parser: a small immutable field fix
This commit is contained in:
parent
343dced36d
commit
ae2af4c36d
3 changed files with 14 additions and 6 deletions
|
@ -107,3 +107,14 @@ fn test_reserved_keywords() {
|
|||
assert rk_holder2.volatile == 11
|
||||
assert rk_holder2.while == 0 //Zero value as not specified.
|
||||
}
|
||||
|
||||
struct User2 {
|
||||
mut:
|
||||
name string
|
||||
}
|
||||
|
||||
fn test_mutable_fields() {
|
||||
mut u := User2{}
|
||||
u.name = 'Peter'
|
||||
assert u.name == 'Peter'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue