mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix assert value is '*unknown value*' (#15645)
This commit is contained in:
parent
4bd49a0149
commit
1ef95fdec6
@ -147,9 +147,16 @@ fn (mut g Gen) gen_assert_single_expr(expr ast.Expr, typ ast.Type) {
|
||||
// eprintln('> gen_assert_single_expr typ: $typ | expr: $expr | typeof(expr): ${typeof(expr)}')
|
||||
unknown_value := '*unknown value*'
|
||||
match expr {
|
||||
ast.CastExpr, ast.IfExpr, ast.IndexExpr, ast.MatchExpr {
|
||||
ast.CastExpr, ast.IfExpr, ast.MatchExpr {
|
||||
g.write(ctoslit(unknown_value))
|
||||
}
|
||||
ast.IndexExpr {
|
||||
if expr.index is ast.RangeExpr {
|
||||
g.write(ctoslit(unknown_value))
|
||||
} else {
|
||||
g.gen_expr_to_string(expr, typ)
|
||||
}
|
||||
}
|
||||
ast.PrefixExpr {
|
||||
if expr.right is ast.CastExpr {
|
||||
// TODO: remove this check;
|
||||
|
Loading…
Reference in New Issue
Block a user