We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was surprised to find that this snippet
const Foo = struct { bar: u32, pub fn bar(self: *Foo) u32 { return self.bar; } }; test "bar" { var b = Foo{ .bar = 0 }; _ = b.bar(); }
gives the following error
$ zig test typeIsNotAFunction.zig typeIsNotAFunction.zig:11:10: error: type 'u32' not a function _ = b.bar(); ^
I think Zig should first warn of an identifier clash, instead of choosing the struct member, and trying to use its type (??).
The text was updated successfully, but these errors were encountered:
Duplicate of #705.
Sorry, something went wrong.
No branches or pull requests
I was surprised to find that this snippet
gives the following error
I think Zig should first warn of an identifier clash, instead of choosing the struct member, and trying to use its type (??).
The text was updated successfully, but these errors were encountered: