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-2024-09:c1264c2a7
OS: EndeavourOS, Linux 6.10.10-arch1-1
CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
RAM: 23801 MiB
Backend: LLVM 18.1.8
Consider the following code:
foo :: proc(a, b: [$N]$T) -> [N*2]T where N * 2 < 16 {
// do some stuff here
fmt.println(N * 2)
return [N * 2]T{}
}
Everything else works, except the part where we multiply N by two in the return type.
Expected Behavior
To be able to perform arithmetic operations on polymporhic variables, like in the function body or where clauses.
Current Behavior
It throws the following error:
/home/user/projects/tests/main.odin(15:31) Error: 'N' is not an expression but a type, in this context it is ambiguous
foo :: proc(a, b: [$N]$T) -> [N * 2]T where N * 2 < 16 {
The text was updated successfully, but these errors were encountered:
Context
odin report
:Consider the following code:
Everything else works, except the part where we multiply N by two in the return type.
Expected Behavior
To be able to perform arithmetic operations on polymporhic variables, like in the function body or where clauses.
Current Behavior
It throws the following error:
The text was updated successfully, but these errors were encountered: