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

vfmt: voidptr(0) => unsafe { nil } (p.1)

This commit is contained in:
Alexander Medvednikov
2022-07-21 20:45:57 +03:00
parent be9f8cc777
commit caa0c2f153
17 changed files with 153 additions and 123 deletions

View File

@@ -457,7 +457,7 @@ pub fn (mut c Checker) struct_init(mut node ast.StructInit) ast.Type {
if mut field.expr is ast.Ident {
if mut field.expr.obj is ast.Var {
mut obj := unsafe { &field.expr.obj }
if c.fn_scope != voidptr(0) {
if c.fn_scope != unsafe { nil } {
obj = c.fn_scope.find_var(obj.name) or { obj }
}
if obj.is_stack_obj && !c.inside_unsafe {