no :: in func decls

This commit is contained in:
2026-06-30 19:31:26 +02:00
parent ae5af37b85
commit 07c560b750
107 changed files with 580 additions and 520 deletions
+3 -3
View File
@@ -6,7 +6,7 @@
# The return value is captured before defers run, so the mutation here does not
# change what is returned (Zig semantics).
spill_check :: func() i32 {
spill_check func() i32 {
x i32 = 5
defer x = 999
return x
@@ -14,7 +14,7 @@ spill_check :: func() i32 {
# A function-scope defer runs only at function exit; a `break` runs the loop-body
# defer but NOT the enclosing function-scope defer.
enclosing_defer_check :: func() i32 {
enclosing_defer_check func() i32 {
v i32 = 0
defer v = v + 100
for 0..3 |i| {
@@ -24,7 +24,7 @@ enclosing_defer_check :: func() i32 {
return v # 0->1 (i=0 fall-through), ->2 (i=1 break); the +100 runs after capture
}
main :: func() i32 {
main func() i32 {
# 1. return value captured before defers run.
if (spill_check() != 5) return 101