On wrong append call, help users pass-by-pointer #5817
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY?
First Odin users that try to use append often forget to pass a pointer, and pass-by-value.
This is a first attempt at helping with that, but a better version would be a generic way to check when any proc values should be pass-by-pointer instead of pass-by-value, as discussed at https://forum.odin-lang.org/t/least-parsable-most-common-error-message/1241/3
Better takes on it
a. Check, efficiently, if any argument match a pointer type of the possible procs
b. If so, have the pass-by-pointer message for that/those argument(s).
Why not have done those things already
I need more practice with C++, not yet familiar enough to make it good and generic yet.
So I might come back to it later.