mirror of
https://github.com/vlang/v.git
synced 2025-09-16 07:52:32 +03:00
compiler: error on unused imports
This commit is contained in:
parent
71484e89d6
commit
23c84516e2
29 changed files with 112 additions and 55 deletions
|
@ -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++
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue