mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: allow mutable pointer args
This commit is contained in:
parent
b495dac780
commit
0641a31fe0
@ -170,7 +170,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
|
||||
continue
|
||||
}
|
||||
sym := p.table.get_type_symbol(arg.typ)
|
||||
if sym.kind !in [.array, .struct_, .map, .placeholder] {
|
||||
if sym.kind !in [.array, .struct_, .map, .placeholder] && !arg.typ.is_ptr() {
|
||||
p.error('mutable arguments are only allowed for arrays, maps, and structs\n' +
|
||||
'return values instead: `fn foo(n mut int) {` => `fn foo(n int) int {`')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user