Skip to content

Instantly share code, notes, and snippets.

@daurnimator
Created April 15, 2019 16:03
Show Gist options
  • Save daurnimator/b85e04aef327eda7c6ac7ade72d44cfe to your computer and use it in GitHub Desktop.
Save daurnimator/b85e04aef327eda7c6ac7ade72d44cfe to your computer and use it in GitHub Desktop.
zig struct field vs method shadowing
const std = @import("std");
const A = struct {
pub foo: i32,
pub fn foo() void {
}
};
test "shadowing" {
std.debug.warn("{}", @typeName(@typeOf(A.foo))); // fn() void
}
@daurnimator
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment