We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Useful information to add to a bug report: Odin: dev-2024-09:a16d3b6c9 OS: openSUSE Tumbleweed, Linux 6.10.7-1-default CPU: AMD Ryzen 9 5900X 12-Core Processor RAM: 31999 MiB Backend: LLVM 18.1.8
The default value calculated for a polymorphic constant will match what's calculated in a polymorphic procedure.
The const values differ.
Reproduction:
package test import "core:fmt" LEN :: 64 S :: struct ($T, $U: typeid, $Count := LEN / max(size_of(T), size_of(U))) {} make_s :: proc($T, $U: typeid) -> S(T, U, LEN / max(size_of(T), size_of(U))) { return {} } main :: proc() { wrong_count: S(f64, [2]int) correct_count := make_s(f64, [2]int) fmt.println("expected:", LEN / max(size_of(f64), size_of([2]int))) fmt.println("wrong:", wrong_count) fmt.println("correct:", correct_count) }
$Count
wrong_count
Output of the reproduction:
$ odin run . expected: 4 wrong: S($T=f64, $U=[2]int, $Count=8){} correct: S($T=f64, $U=[2]int, $Count=4){}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Context
Expected Behavior
The default value calculated for a polymorphic constant will match what's calculated in a polymorphic procedure.
Current Behavior
The const values differ.
Failure Information (for bugs)
Reproduction:
Steps to Reproduce
$Count
differ in the print ofwrong_count
to the expected one.Failure Logs
Output of the reproduction:
The text was updated successfully, but these errors were encountered: