From d73586743b410967a153c7ddd4823f41e71ade8a Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 7 Dec 2019 19:33:59 +0300 Subject: [PATCH] fix assert in functions that return values --- vlib/compiler/parser.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/compiler/parser.v b/vlib/compiler/parser.v index 2e4c068d96..bd8b9f867c 100644 --- a/vlib/compiler/parser.v +++ b/vlib/compiler/parser.v @@ -2663,7 +2663,7 @@ if (!$tmp) { eprintln(tos3("${filename}:${p.scanner.line_nr}: FAILED: ${cfname}()")); eprintln(tos3("Source: $sourceline")); v_panic(tos3("An assertion failed.")); - return; + exit(1); } else { g_test_oks++; } @@ -2680,7 +2680,7 @@ if (!$tmp) { tos3("$sourceline"), tos3("$p.cur_fn.name()") ); - return; + exit(1); // TODO // Maybe print all vars in a test function if it fails? } else {