parser: fix passing the is_mut flag of anon fn arguments

pull/5965/head
Delyan Angelov 2020-07-24 11:27:56 +03:00
parent d204c926a8
commit 8c4429c875
1 changed files with 4 additions and 2 deletions

View File

@ -194,6 +194,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
rec_type = rec_type.set_flag(.atomic_f)
}
args << table.Arg{
pos: rec_start_pos
name: rec_name
is_mut: rec_mut
typ: rec_type
@ -235,7 +236,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
name: arg.name
typ: arg.typ
is_mut: arg.is_mut
pos: p.tok.position()
pos: arg.pos
is_used: true
is_arg: true
})
@ -341,7 +342,8 @@ fn (mut p Parser) anon_fn() ast.AnonFn {
p.scope.register(arg.name, ast.Var{
name: arg.name
typ: arg.typ
pos: p.tok.position()
is_mut: arg.is_mut
pos: arg.pos
is_used: true
is_arg: true
})