Skip to content
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

Resolve array ** and ++ operators #2130

Merged
merged 3 commits into from
Jan 5, 2025
Merged

Conversation

estevesnp
Copy link
Contributor

Resolves the mult and cat operators for arrays and single pointers to arrays.
I could look more into the other cases (string literals, tuples and comptime known slices), but would take more time.

(partly) fixes #2105

@estevesnp
Copy link
Contributor Author

I could also try to check if we could infer the size of the array by calculating it in cases where we know the actual number / array length on the right side

@Techatrix
Copy link
Member

I could also try to check if we could infer the size of the array by calculating it in cases where we know the actual number / array length on the right side

resolving the array length would be nice. You can use the resolveIntegerLiteral function to resolve the integer value of the right side.

These changes will need test coverage. I would suggest to add some tests to hover.zig.

@estevesnp
Copy link
Contributor Author

resolving the array length would be nice. You can use the resolveIntegerLiteral function to resolve the integer value of the right side.

These changes will need test coverage. I would suggest to add some tests to hover.zig.

should be done, thanks for the pointers!

Copy link
Member

@Techatrix Techatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great. thank you

@Techatrix Techatrix merged commit fdfaa63 into zigtools:master Jan 5, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resolve ** and ++ operators
2 participants