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-2025-01-nightly:2aae4cf
OS: Windows 10 Professional (version: 22H2), build 19045.5247
Backend: LLVM 18.1.8
Expected Behavior
a := []i32{4, 5, 6}
fmt.println(a[5:])
// Ensuring is a slice
info := type_info_of(typeid_of(type_of(a))) // []i32
size_of(a) // 16 which is 8 for the pointer and 8 for the len
size_of([3]i32) // 12 which is 4 for one element * 3 for the number of elements
Given that a is a slice of a FIXED ARRAY and I'm taking a slice to a certain bounds with COMPILE TIME CONSTANTS, why isn't the bounds check done at compile time rather than exclusively at runtime?
The text was updated successfully, but these errors were encountered:
Context
Odin: dev-2025-01-nightly:2aae4cf
OS: Windows 10 Professional (version: 22H2), build 19045.5247
Backend: LLVM 18.1.8
Expected Behavior
Given that
a
is a slice of a FIXED ARRAY and I'm taking a slice to a certain bounds with COMPILE TIME CONSTANTS, why isn't the bounds check done at compile time rather than exclusively at runtime?The text was updated successfully, but these errors were encountered: