Skip to content

'use' doesn't work on normal structs #2217

New issue

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

Closed
Hejsil opened this issue Apr 9, 2019 · 1 comment · Fixed by #2518
Closed

'use' doesn't work on normal structs #2217

Hejsil opened this issue Apr 9, 2019 · 1 comment · Fixed by #2518
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@Hejsil
Copy link
Contributor

Hejsil commented Apr 9, 2019

Since all files are now empty structs, I'd assume this should work, as there is no semantic difference between having S and A be files or structs.

const A = struct {
    pub fn a() void {}
};

const S = struct {
    pub use @import("a.zig");
};

test "" {
    S.a(); // test.zig:10:6: error: container 'S' has no member called 'a'
}
@andrewrk andrewrk added this to the 0.5.0 milestone Apr 9, 2019
@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Apr 9, 2019
@emekoi
Copy link
Contributor

emekoi commented Apr 9, 2019

related #1214.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants