mirror of
https://github.com/vlang/v.git
synced 2025-09-16 10:57:25 -04:00
ci,cgen: put the Interface(unsafe{nil})
change for now behind -experimental (#21593)
This commit is contained in:
parent
2d5c457901
commit
a6016530f1
@ -2564,12 +2564,14 @@ fn (mut g Gen) expr_with_cast(expr ast.Expr, got_type_raw ast.Type, expected_typ
|
|||||||
if exp_sym.info.is_generic {
|
if exp_sym.info.is_generic {
|
||||||
fname = g.generic_fn_name(exp_sym.info.concrete_types, fname)
|
fname = g.generic_fn_name(exp_sym.info.concrete_types, fname)
|
||||||
}
|
}
|
||||||
// Do not allocate for `Interface(unsafe{nil})` casts
|
if g.pref.experimental {
|
||||||
is_nil_cast := expr is ast.UnsafeExpr && expr.expr is ast.Nil
|
// Do not allocate for `Interface(unsafe{nil})` casts
|
||||||
if is_nil_cast {
|
is_nil_cast := expr is ast.UnsafeExpr && expr.expr is ast.Nil
|
||||||
g.write('/*nili*/')
|
if is_nil_cast {
|
||||||
g.write('((void*)0)')
|
g.write('/*nili*/')
|
||||||
return
|
g.write('((void*)0)')
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
g.call_cfn_for_casting_expr(fname, expr, expected_is_ptr, exp_styp, got_is_ptr,
|
g.call_cfn_for_casting_expr(fname, expr, expected_is_ptr, exp_styp, got_is_ptr,
|
||||||
false, got_styp)
|
false, got_styp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user