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
Odin: dev-2022-09-nightly:74458ab0
OS: Windows 10 Professional (version: 21H1), build 19043.1889
CPU: Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
RAM: 32681 MiB
Expected Behavior
using statement would work fine on #soa pointers, just like on normal pointers and structs.
Current Behavior
When I try to use using on a #soa pointer, compiler shows an error. It seems like the compiler thinks the value is an immutable procedure parameter. Note that assigning a value directly without the using statement works fine.
Failure Information (for bugs)
In the example below, the compiler shows this error: Cannot assign to 'b' which is from a 'using' procedure parameter
Steps to Reproduce
Here is a short example code which triggers the error:
Foo :: struct {
a, b, c: f32,
}
main :: proc() {
foos: #soa[32]Foo
for i in0..<len(foos) {
updateFoo(&foos[i])
}
}
updateFoo :: proc(foo: #soa^#soa[32]Foo) {
// Working with foo directly is without any issues:
foo.a = 123
foo.b = 456using foo
b = 1234// Error: Cannot assign to 'b' which is from a 'using' procedure parameter
}
Also when using is applied directly to the procedure parameter, the compiler shows a different error - Cannot assign to 'b':
Context
Operating System & Odin Version:
Expected Behavior
using
statement would work fine on#soa
pointers, just like on normal pointers and structs.Current Behavior
When I try to use
using
on a#soa
pointer, compiler shows an error. It seems like the compiler thinks the value is an immutable procedure parameter. Note that assigning a value directly without theusing
statement works fine.Failure Information (for bugs)
In the example below, the compiler shows this error:
Cannot assign to 'b' which is from a 'using' procedure parameter
Steps to Reproduce
Here is a short example code which triggers the error:
Also when
using
is applied directly to the procedure parameter, the compiler shows a different error -Cannot assign to 'b'
:I'm using just
odin run
to run this example.The text was updated successfully, but these errors were encountered: