diff --git a/vlib/v/fmt/tests/c_fn_headers_with_comments_expected.vv b/vlib/v/fmt/tests/c_fn_headers_with_comments_expected.vv new file mode 100644 index 0000000000..95934f8cc5 --- /dev/null +++ b/vlib/v/fmt/tests/c_fn_headers_with_comments_expected.vv @@ -0,0 +1,7 @@ +module main + +fn main() { + println('Hello World!') +} + +fn C.f( /* mut */ buff &char) i64 diff --git a/vlib/v/fmt/tests/c_fn_headers_with_comments_input.vv b/vlib/v/fmt/tests/c_fn_headers_with_comments_input.vv new file mode 100644 index 0000000000..88945f3ba4 --- /dev/null +++ b/vlib/v/fmt/tests/c_fn_headers_with_comments_input.vv @@ -0,0 +1,7 @@ +module main + +fn main() { + println('Hello World!') +} + +fn C.f(/*mut*/buff &char) i64 diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index f8bf4cd8ab..a16034b4d8 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -948,6 +948,7 @@ fn (mut p Parser) fn_params() ([]ast.Param, bool, bool) { is_mut: is_mut typ: param_type type_pos: type_pos + comments: comments } param_no++ if param_no > 1024 {