all: make 0 => unsafe { nil } an error, not a notice

This commit is contained in:
Alexander Medvednikov 2024-10-07 01:54:19 +03:00
parent a2d385aee3
commit 2b52153c14
15 changed files with 26 additions and 33 deletions

View file

@ -6707,16 +6707,16 @@ struct Node {
}
// Reference fields must be initialized unless an initial value is declared.
// Zero (0) is OK but use with caution, it's a nil pointer.
// Nil is OK but use with caution, it's a nil pointer.
foo := Node{
a: 0
a: unsafe { nil }
}
bar := Node{
a: &foo
}
baz := Node{
a: 0
b: 0
a: unsafe { nil }
b: unsafe { nil }
}
qux := Node{
a: &foo