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

compiler: more actionable error message, when fn main is missing

This commit is contained in:
Delyan Angelov 2020-02-08 18:00:13 +02:00 committed by GitHub
parent a2d2586331
commit a02e1e0af2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -468,7 +468,7 @@ pub fn (v mut V) generate_main() {
v.gen_main_end('return 0') v.gen_main_end('return 0')
} }
else if v.v_fmt_file=='' && !v.pref.is_repl { else if v.v_fmt_file=='' && !v.pref.is_repl {
verror('function `main` is not declared in the main module') verror('function `main` is not declared in the main module\nPlease add: \nfn main(){\n}\n... to your main program .v file, and try again.')
} }
} }
else if v.pref.is_test { else if v.pref.is_test {