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
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Odin: dev-2024-12-nightly:cf53404
OS: Windows 10 Enterprise N (version: 20H2), build 19042.1466
CPU: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
RAM: 65470 MiB
Backend: LLVM 18.1.8
Expected Behavior
This
package main
A :: struct {
a : struct { // Illegal declaration cycle of `a`
t : u32
},
b : [1024 - size_of(a)]u8,
}
main :: proc() { }
should compile as the size of a should already be known by the time it is used, but it doesn't.
a : u32;
A :: struct {
b : [1024 - size_of(a)]u8,
}
main :: proc() { }
does compile without issues.
Current Behavior
The compiler errors with
Error: Illegal declaration cycle of a
a : struct { // Illegal declaration cycle of a
Failure Information (for bugs)
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
copy the first snippet into a new file
run odin build on the file
error
The text was updated successfully, but these errors were encountered:
SaculRennorb
changed the title
'Illegal declaration of cycle' when outer struct references inner member size
'Illegal declaration of cycle' when struct member references sibling member size
Jan 5, 2025
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Expected Behavior
This
should compile as the size of a should already be known by the time it is used, but it doesn't.
does compile without issues.
Current Behavior
The compiler errors with
Failure Information (for bugs)
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
The text was updated successfully, but these errors were encountered: