checker: fix compilation of vlib/v/slow_tests/assembly/asm_test.amd64.v (regression after dfc0c91)

This commit is contained in:
Delyan Angelov 2024-09-13 08:36:44 +03:00
parent 4572c64759
commit 73bdcd378c
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -871,9 +871,12 @@ fn (mut c Checker) check_uninitialized_struct_fields_and_embeds(node ast.StructI
} else {
parts.last()
}
c.error('cannot access private field `${field.name}` on `${mod_type}`',
init_field.pos)
break
if !c.inside_unsafe {
c.error('cannot access private field `${field.name}` on `${mod_type}`',
init_field.pos)
break
}
}
}
}