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

builder: do not allow importing 'builtin' module

This commit is contained in:
Swastik Baranwal 2020-05-21 20:01:41 +05:30 committed by GitHub
parent cb82ff618b
commit bf7ab19d09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,6 +60,10 @@ pub fn (mut b Builder) parse_imports() {
ast_file := b.parsed_files[i]
for _, imp in ast_file.imports {
mod := imp.mod
if mod == 'builtin' {
verror('cannot import module "$mod"')
break
}
if mod in done_imports {
continue
}