mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: error on unused imports
This commit is contained in:

committed by
Alexander Medvednikov

parent
71484e89d6
commit
23c84516e2
@ -653,11 +653,13 @@ fn (v mut V) add_v_files_to_compile() {
|
||||
}
|
||||
}
|
||||
// Add remaining user files
|
||||
mut i := 0
|
||||
mut j := 0
|
||||
mut len := -1
|
||||
for i, fit in v.table.file_imports {
|
||||
for _, fit in v.table.file_imports {
|
||||
// Don't add a duplicate; builtin files are always there
|
||||
if fit.file_path in v.files || fit.module_name == 'builtin' {
|
||||
i++
|
||||
continue
|
||||
}
|
||||
if len == -1 {
|
||||
@ -671,6 +673,7 @@ fn (v mut V) add_v_files_to_compile() {
|
||||
//println(fit)
|
||||
//println('fit $fit.file_path')
|
||||
v.files << fit.file_path
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user