diff --git a/vlib/v/checker/tests/modules/enum_from_string_in_different_mods.out b/vlib/v/checker/tests/modules/enum_from_string_in_different_mods.out index e597eb825383c3..9a5cc8986622d3 100644 --- a/vlib/v/checker/tests/modules/enum_from_string_in_different_mods.out +++ b/vlib/v/checker/tests/modules/enum_from_string_in_different_mods.out @@ -1,10 +1,3 @@ -vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:3:8: warning: module 'mod' is imported but never used - 1 | module main - 2 | - 3 | import mod { MyEnum, MyStruct } - | ~~~ - 4 | - 5 | fn main() { vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:3:14: error: module `mod` type `MyEnum` is private 1 | module main 2 | diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index d3d9b6553da895..0ddfb0e037bfea 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -747,6 +747,9 @@ fn (mut p Parser) check_name() string { name := p.tok.lit if p.tok.kind != .name && p.peek_tok.kind == .dot && name in p.imports { p.register_used_import(name) + } else if p.tok.kind == .name && p.peek_tok.kind == .dot && name in p.imported_symbols { + // symbols like Enum.field_name + p.register_used_import_for_symbol_name(p.imported_symbols[name]) } if !is_ident_name(name) { p.check(.name) diff --git a/vlib/v/slow_tests/inout/import_sym_field_no_warn.out b/vlib/v/slow_tests/inout/import_sym_field_no_warn.out new file mode 100644 index 00000000000000..09eb42eeed510c --- /dev/null +++ b/vlib/v/slow_tests/inout/import_sym_field_no_warn.out @@ -0,0 +1 @@ +same_site_not_set diff --git a/vlib/v/slow_tests/inout/import_sym_field_no_warn.vv b/vlib/v/slow_tests/inout/import_sym_field_no_warn.vv new file mode 100644 index 00000000000000..9250634bb3990c --- /dev/null +++ b/vlib/v/slow_tests/inout/import_sym_field_no_warn.vv @@ -0,0 +1,7 @@ +import net.http { SameSite } + +fn main() { + mime := SameSite.same_site_not_set + + println(mime) +}