diff --git a/cmd/v/v.v b/cmd/v/v.v index b3b5fa38e8..c1d5ae1552 100644 --- a/cmd/v/v.v +++ b/cmd/v/v.v @@ -47,8 +47,8 @@ fn main() { return } prefs, command := parse_args(args) - //println('main() command = $command') if prefs.is_verbose { + println('command = "$command"') println(util.full_v_version()) } if prefs.is_verbose { @@ -168,6 +168,12 @@ fn parse_args(args []string) (&pref.Preferences, string) { if command.ends_with('.v') || os.exists(command) { res.path = command } + else if command == 'run' { + res.path = args[args.len-1] + } + if res.is_verbose { + println('setting pref.path to "$res.path"') + } res.fill_with_defaults() return res, command } diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index c2f22957db..285cf91333 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -117,7 +117,7 @@ fn (p mut Parser) fn_decl() ast.FnDecl { p.error('function names cannot contain uppercase letters, use snake_case instead') } if is_method && p.table.get_type_symbol(rec_type).has_method(name) { - p.warn('duplicate method `$name`') + p.error('duplicate method `$name`') } } if p.tok.kind in [.plus, .minus, .mul, .div, .mod] {