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

make empty module dir error less confusing

This commit is contained in:
joe-conigliaro 2019-07-27 10:18:56 +10:00 committed by Alexander Medvednikov
parent 80ec11edcb
commit 26a1762156

View File

@ -921,9 +921,10 @@ fn (v mut V) add_user_v_files() {
for i := 0; i < v.table.imports.len; i++ {
mod := v.table.imports[i]
mod_path := v.module_path(mod)
vfiles := v.v_files_from_dir('$ModPath/vlib/$mod_path')
import_path := '$ModPath/vlib/$mod_path'
vfiles := v.v_files_from_dir(import_path)
if vfiles.len == 0 {
panic('cannot import module $mod, it does not exist.')
panic('cannot import module $mod (no .v files in "$import_path").')
}
// Add all imports referenced by these libs
for file in vfiles {
@ -946,7 +947,7 @@ fn (v mut V) add_user_v_files() {
}
vfiles := v.v_files_from_dir(import_path)
if vfiles.len == 0 {
panic('cannot import module $mod, it does not exist.')
panic('cannot import module $mod (no .v files in "$import_path").')
}
// Add all imports referenced by these libs
for file in vfiles {