Skip to content

Structs with anytype fields do not initialize correctly #11576

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
bpeake13 opened this issue May 4, 2022 · 2 comments
Closed

Structs with anytype fields do not initialize correctly #11576

bpeake13 opened this issue May 4, 2022 · 2 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@bpeake13
Copy link

bpeake13 commented May 4, 2022

Zig Version

0.9.1

Steps to Reproduce

Example program can be found here: https://godbolt.org/z/fbvqE66vq

Expected Behavior

Tuples that contain type fields should compile into fields that are marked as anytype

Actual Behavior

If a struct is provided that has anytype fields, then providing a tuple that has a type to those fields will result in an invalid array access error.

@bpeake13 bpeake13 added the bug Observed behavior contradicts documented or intended behavior label May 4, 2022
@luehmann
Copy link
Contributor

luehmann commented May 4, 2022

anytype fields got removed anyway. see #10705

If you change the compiler version to zig trunk you can see the new compile error:

4:8: error: expected type expression, found 'anytype'

@ifreund ifreund closed this as completed May 4, 2022
@bpeake13
Copy link
Author

bpeake13 commented May 4, 2022

@luehmann good to know, thanks!

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

No branches or pull requests

3 participants