Skip to content

Compiler crashes when using a struct T which contains a field of type ArrayList(T) #1832

Closed
@svc-user

Description

@svc-user

When running the code below zig fails without printing any information as to what went wrong (or any other information for that matter). No files are being created either.
I'm expecting the compiler to tell me if I do something wrong.

Zig version:

0.3.0+bbdc1289

Platform:

Windows 10 Pro N

Return Code:

-1073741819

Code:

const std = @import("std");

pub fn main() void {
    _ = Node {
        .subList = undefined
    };
}

const Node = struct {
    subList: std.ArrayList(Node)
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions