From aded6088e9686f20b356394527345a8d2084b31f Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+tobealive@users.noreply.github.com> Date: Fri, 19 May 2023 15:28:01 +0200 Subject: [PATCH] vet: allow vetting files with global variables (#18195) --- vlib/v/parser/parser.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 4ea0a7ae34..866aa7855b 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -3788,8 +3788,9 @@ fn (mut p Parser) global_decl() ast.GlobalDecl { } } - if !p.has_globals && !p.pref.enable_globals && !p.pref.is_fmt && !p.pref.translated - && !p.is_translated && !p.pref.is_livemain && !p.pref.building_v && !p.builtin_mod { + if !p.has_globals && !p.pref.enable_globals && !p.pref.is_fmt && !p.pref.is_vet + && !p.pref.translated && !p.is_translated && !p.pref.is_livemain && !p.pref.building_v + && !p.builtin_mod { p.error('use `v -enable-globals ...` to enable globals') return ast.GlobalDecl{} }