From a5b4ed29098af03a7260cb3cdf392b0806cd371e Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Mon, 30 Sep 2019 20:40:19 +1000 Subject: [PATCH] compiler: typo in module name erroneously reports "import cycle" --- compiler/main.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/main.v b/compiler/main.v index e926c478cc..acf64f4cd2 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -656,6 +656,9 @@ fn (v mut V) add_v_files_to_compile() { for file in vfiles { mut p := v.new_parser_file(file) p.parse(.imports) + if p.import_table.module_name != mod { + verror('bad module name: $file was imported as `$mod` but it is defined as module `$p.import_table.module_name`') + } //if p.pref.autofree { p.scanner.text.free() free(p.scanner) } } }