1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: typo in module name erroneously reports "import cycle"

This commit is contained in:
joe-conigliaro 2019-09-30 20:40:19 +10:00 committed by Alexander Medvednikov
parent e72fe25224
commit a5b4ed2909

View File

@ -656,6 +656,9 @@ fn (v mut V) add_v_files_to_compile() {
for file in vfiles { for file in vfiles {
mut p := v.new_parser_file(file) mut p := v.new_parser_file(file)
p.parse(.imports) 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) } //if p.pref.autofree { p.scanner.text.free() free(p.scanner) }
} }
} }