1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: a small immutable field fix

This commit is contained in:
Alexander Medvednikov
2019-10-13 01:50:15 +03:00
parent 343dced36d
commit ae2af4c36d
3 changed files with 14 additions and 6 deletions

View File

@@ -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'
}