mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix checking uninitialized refs
This commit is contained in:
@@ -330,7 +330,7 @@ pub fn (mut c Checker) struct_init(struct_init mut ast.StructInit) table.Type {
|
|||||||
}
|
}
|
||||||
// Check uninitialized refs
|
// Check uninitialized refs
|
||||||
for field in info.fields {
|
for field in info.fields {
|
||||||
if field.name in inited_fields {
|
if field.has_default_expr || field.name in inited_fields {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if field.typ.is_ptr() {
|
if field.typ.is_ptr() {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
module main
|
module main
|
||||||
struct Node {
|
struct Node {
|
||||||
data int
|
data int
|
||||||
next &Node = 0
|
next &Node
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main(){
|
fn main(){
|
||||||
|
Reference in New Issue
Block a user