Skip to content

Commit

Permalink
parser,fmt: inform about invalid interop function bodies instead of r…
Browse files Browse the repository at this point in the history
…emoving them (#21070)
  • Loading branch information
ttytm committed Mar 21, 2024
1 parent 8a9def6 commit 39eef1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/parser/fn.v
Expand Up @@ -577,7 +577,7 @@ run them via `v file.v` instead',
mut stmts := []ast.Stmt{}
body_start_pos := p.tok.pos()
if p.tok.kind == .lcbr {
if language != .v && language != .js {
if language != .v {
p.error_with_pos('interop functions cannot have a body', body_start_pos)
}
p.inside_fn = true
Expand Down

0 comments on commit 39eef1d

Please sign in to comment.