1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.eval: show sumtype or interface casts return void currently only with -v

This commit is contained in:
Delyan Angelov 2021-12-11 23:45:54 +02:00
parent 23be53e2de
commit adf353702e
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -380,8 +380,10 @@ pub fn (mut e Eval) expr(expr ast.Expr, expecting ast.Type) Object {
}
}
} else if e.table.get_type_symbol(expr.typ).kind in [.interface_, .sum_type] {
eprintln(util.formatted_error('warning:', 'sumtype or interface casts return void currently',
e.cur_file, expr.pos))
if e.pref.is_verbose {
eprintln(util.formatted_error('warning:', 'sumtype or interface casts return void currently',
e.cur_file, expr.pos))
}
} else {
e.error('unknown cast: ${e.table.get_type_symbol(expr.expr_type).str()} to ${e.table.get_type_symbol(expr.typ).str()}')
}