pull/13646/head
Kyle Lin 2022-03-04 01:02:43 +08:00
parent 95ecb92bb5
commit 14ad4a17c6
1 changed files with 2 additions and 2 deletions

View File

@ -466,10 +466,10 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
// Body
p.cur_fn_name = name
mut stmts := []ast.Stmt{}
body_start_pos := p.peek_tok.pos()
body_start_pos := p.tok.pos()
if p.tok.kind == .lcbr {
if language != .v && language != .js {
p.error_with_pos('interop functions cannot have a body', p.tok.pos())
p.error_with_pos('interop functions cannot have a body', body_start_pos)
}
p.inside_fn = true
p.inside_unsafe_fn = is_unsafe