Bug: Changing an immutable parameter #6869
alexoransky
started this conversation in
General
Replies: 1 comment 1 reply
-
|
Hey! This is expected behavior. Odin passes large values by pointer rather than performing a deep copy, primarily for performance reasons. See: #2971 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Odin release dev-2026-06:285f6d87b
Consider the following code:
Run:
cd
odin run .
The expected output is
because the data parameter in the print_union_data() is passed by value.
Instead we are getting:
Curiously enough, the issue disappears when the PersonData type is removed from MyUnion.
Beta Was this translation helpful? Give feedback.
All reactions