Files
sx/examples/comptime/0611-comptime-integral-float-inline-for.sx
agra 66bdc70bf1 test: group examples into per-category folders
Move examples/*.sx and their expected/ snapshots into per-category
subfolders (examples/<category>/...). Folder = leading filename token,
with ffi-objc/ffi-jni kept whole; filenames are unchanged. The corpus
runner and LSP sweep now discover each category's expected/ dir, while
issues/ stays flat. Example 1058's repo-root-relative companion import
is made file-relative. Path strings embedded in 164 snapshots were
regenerated (path-only changes). Test-layout docs in CLAUDE.md updated.
2026-06-21 14:41:34 +03:00

15 lines
480 B
Plaintext

// An `inline for 0..M` bound accepts an integral float constant — `M :: 3.0`
// unrolls the same three iterations as `M :: 3`. The inline-for bound folder
// (`evalComptimeInt`) delegates to the shared const-int evaluator, so the
// integral-float rule (issue 0083 / F0.4 attempt 8, Agra ruling) applies here
// too.
#import "modules/std.sx";
M :: 3.0;
main :: () {
s := 0;
inline for 0..M (i) { s += i; }
print("sum 0..M = {}\n", s); // 0 + 1 + 2 = 3
}