From 6749979534dbdc0e46ebe4087ab3133648c25983 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 29 Nov 2021 16:30:45 +0200 Subject: [PATCH] builder: fix the uhm `fine` module lookup bug (part 1) --- vlib/v/builder/builder.v | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vlib/v/builder/builder.v b/vlib/v/builder/builder.v index 2c02e875e7..3b3ba045e4 100644 --- a/vlib/v/builder/builder.v +++ b/vlib/v/builder/builder.v @@ -197,10 +197,11 @@ pub fn (mut b Builder) parse_imports() { if name == '' { name = file.mod.short_name } - if name != mod { - // v.parsers[pidx].error_with_token_index('bad module definition: ${v.parsers[pidx].file_path} imports module "$mod" but $file is defined as module `$p_mod`', 1 - b.parsed_files[i].errors << b.error_with_pos('bad module definition: $ast_file.path imports module "$mod" but $file.path is defined as module `$name`', - ast_file.path, imp.pos) + sname := name.all_after_last('.') + smod := mod.all_after_last('.') + if sname != smod { + msg := 'bad module definition: $ast_file.path imports module "$mod" but $file.path is defined as module `$name`' + b.parsed_files[i].errors << b.error_with_pos(msg, ast_file.path, imp.pos) } } b.parsed_files << parsed_files