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

map_test.v: format + ref test

This commit is contained in:
Alexander Medvednikov 2019-08-31 16:24:37 +03:00
parent af5b2e1b3c
commit 961e778ed1
2 changed files with 67 additions and 56 deletions

View File

@ -522,7 +522,7 @@ fn (p &Parser) find_type(name string) &Type {
return typ
}
fn (t &Table) find_type(name_ string) *Type {
fn (t &Table) find_type(name_ string) &Type {
mut name := name_
if name.ends_with('*') && !name.contains(' ') {
name = name.left(name.len - 1)

View File

@ -163,3 +163,14 @@ fn test_string_arr() {
assert m['a'][0] == 'one'
assert m['a'][1] == 'two'
}
/*
fn test_ref() {
m := { 'one': 1 }
// TODO "cannot take the address of m['one']"
mut one := &m['one']
one++
println(*one)
}
*/