diff --git a/compiler/parser.v b/compiler/parser.v index 82000374d0..279ef39684 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -761,7 +761,7 @@ fn (p mut Parser) error(s string) { } // p.scanner.debug_tokens() // Print `[]int` instead of `array_int` in errors - p.scanner.error(s.replace('array_', '[]').replace('__', '.')) + p.scanner.error(s.replace('array_', '[]').replace('__', '.').replace('Option_', '?')) } fn (p &Parser) first_run() bool { diff --git a/compiler/tests/option_test.v b/compiler/tests/option_test.v index 6e90d207fc..4b619a0416 100644 --- a/compiler/tests/option_test.v +++ b/compiler/tests/option_test.v @@ -10,6 +10,7 @@ fn test_err(){ } fn err_call(ok bool) ?int { +return 'sdf' if !ok { return error('Not ok!') }