From fd8cf6150bfb88359f16fecb2d34008365483eac Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 15 Apr 2026 14:58:07 +0300 Subject: [PATCH] cgen: fix c error from a name shadow using the same name as a C function in unsafe (fixes #17831) --- ...hadowed_c_fn_call_with_same_name_as_c_struct_test.c.v | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 vlib/v/tests/c_shadowed_c_fn_call_with_same_name_as_c_struct_test.c.v diff --git a/vlib/v/tests/c_shadowed_c_fn_call_with_same_name_as_c_struct_test.c.v b/vlib/v/tests/c_shadowed_c_fn_call_with_same_name_as_c_struct_test.c.v new file mode 100644 index 000000000..330dec37f --- /dev/null +++ b/vlib/v/tests/c_shadowed_c_fn_call_with_same_name_as_c_struct_test.c.v @@ -0,0 +1,9 @@ +import os as _ + +fn test_shadowed_c_fn_call_with_same_name_as_c_struct() { + path := c'.' + mut stat := C.stat{} + unsafe { + C.stat(path, &stat) + } +} -- 2.39.5