You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Zig 0.8, if I have a struct field of type Dependency, and I try to assign to it a function that returns !Dependency, the compiler just fails without showing any error message.
Reproduce
conststd=@import("std");
pubconstDependency=struct {
a: i32,
/// Remove the ! and the code now workspubfninit() !Dependency {
returnDependency{
.a=5,
};
}
};
pubconstContainer=struct {
dependency: Dependency=Dependency.init(),
};
pubfnmain() void {
std.debug.print("Hello world!\n", .{});
constcontainer=Container{};
std.debug.print("a = {}\n", .{container.dependency.a});
}
The text was updated successfully, but these errors were encountered:
Vexu
added
stage1
The process of building from source via WebAssembly and the C backend.
bug
Observed behavior contradicts documented or intended behavior
labels
Jun 7, 2021
On Zig 0.8, if I have a struct field of type
Dependency
, and I try to assign to it a function that returns!Dependency
, the compiler just fails without showing any error message.Reproduce
The text was updated successfully, but these errors were encountered: