You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is a @static struct variable declared in a procedure, and that variable is used with using inside a nested procedure, it results in an error.
I can't reproduce that error in any other way, so it seems like it was made exactly for that case?
But since assigning to state.foo works, I would expect that using should also work.
example
package bug
main :: proc() {
@static state: struct {
foo: int
}
nested :: proc() {
state.foo = 1// worksusing state
foo = 2// Error: Nested procedures do not capture its parent's variables: foo
}
}
output
bug/bug.odin(12:3) Error: Nested procedures do not capture its parent's variables: foo
foo = 2
^~^
If there is a
@static
struct variable declared in a procedure, and that variable is used withusing
inside a nested procedure, it results in an error.I can't reproduce that error in any other way, so it seems like it was made exactly for that case?
But since assigning to
state.foo
works, I would expect thatusing
should also work.example
output
report
The text was updated successfully, but these errors were encountered: