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
In Zig, structs, unions, and enums with payloads cannot be passed by value to a function.
However this compiles:
const foo = struct
{
x : i32,
y : i32,
};
fn bar(f : foo) {}
pub fn main() -> %void {
var f : foo = undefined;
//bar(f); // <<== it stops to compile when I uncomment this
}
This feels like a bug, the offending function has to be called for error to show.
The text was updated successfully, but these errors were encountered:
andrewrk
changed the title
0.1.1 struct passed by value OK if function is not called
struct passed by value OK if function is not called
Oct 20, 2017
Copied on request from #548 (comment).
Docs states:
However this compiles:
This feels like a bug, the offending function has to be called for error to show.
The text was updated successfully, but these errors were encountered: