From b68656743b59127005d3e8dced56b155778c22d0 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 23 Apr 2026 18:03:47 +0300 Subject: [PATCH] checker: fix C Error: [ ';' expected (got "MessageError") ] (fixes #13484) --- .gitignore | 2 ++ .../modules/imported_struct_field_with_any_type_err.out | 6 ++++++ .../include/lexer/tokens.v | 5 +++++ .../modules/imported_struct_field_with_any_type_err/main.v | 3 +++ 4 files changed, 16 insertions(+) create mode 100644 vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err.out create mode 100644 vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/include/lexer/tokens.v create mode 100644 vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/main.v diff --git a/.gitignore b/.gitignore index 9a55f1c49..d98758094 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ !vlib/v/checker/tests/modules/c_type_cast_imported_from_module/** !vlib/v/checker/tests/modules/c_type_cast_imported_from_module.out !vlib/veb/tests/catchall_route_order_regression_test.v +!vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/** +!vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err.out # unignore c codegen testdata files !vlib/v/gen/c/testdata/*.vv diff --git a/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err.out b/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err.out new file mode 100644 index 000000000..c4532c03e --- /dev/null +++ b/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/include/lexer/tokens.v:4:8: error: cannot use type `any` here + 2 | + 3 | struct Tok { + 4 | value any + | ~~~ + 5 | } diff --git a/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/include/lexer/tokens.v b/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/include/lexer/tokens.v new file mode 100644 index 000000000..7175ec1b1 --- /dev/null +++ b/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/include/lexer/tokens.v @@ -0,0 +1,5 @@ +module lexer + +struct Tok { + value any +} diff --git a/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/main.v b/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/main.v new file mode 100644 index 000000000..1956b6db2 --- /dev/null +++ b/vlib/v/checker/tests/modules/imported_struct_field_with_any_type_err/main.v @@ -0,0 +1,3 @@ +import include.lexer as _ + +fn main() {} -- 2.39.5