File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1370,9 +1370,21 @@ fn (mut g Gen) gen_assert_metainfo(a ast.AssertStmt) string {
1370
1370
fn (mut g Gen) gen_assert_single_expr (e ast.Expr, t table.Type) {
1371
1371
unknown_value := '*unknown value*'
1372
1372
match e {
1373
- ast.CastExpr, ast.IndexExpr, ast.PrefixExpr, ast. MatchExpr {
1373
+ ast.CastExpr, ast.IndexExpr, ast.MatchExpr {
1374
1374
g.write (ctoslit (unknown_value))
1375
1375
}
1376
+ ast.PrefixExpr {
1377
+ if e.right is ast.CastExpr {
1378
+ // TODO: remove this check;
1379
+ // vlib/builtin/map_test.v (a map of &int, set to &int(0)) fails
1380
+ // without special casing ast.CastExpr here
1381
+ g.write (ctoslit (unknown_value))
1382
+ } else {
1383
+ g.gen_expr_to_string (e, t) or {
1384
+ g.write (ctoslit ('[$err ]' ))
1385
+ }
1386
+ }
1387
+ }
1376
1388
ast.Type {
1377
1389
sym := g.table.get_type_symbol (t)
1378
1390
g.write (ctoslit ('$sym.name ' ))
You can’t perform that action at this time.
0 commit comments