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
{{ message }}
Repository navigation
flowc strict check: sizeof<T>() is an undefined function (sizeof_i64) #952
Two checker gaps that block the pthread size test.
function main() -> i32 {
if sizeof<i64>() != 8 { return 1 }
return 0
}
import "stdlib/concurrent.flow"
function main() -> i32 {
let m: Mutex = mutex_new()
mutex_destroy(m)
return 0
}
Observed: first program: flowc tc: unbound call at 2:8 (sizeof). Second: flowc tc: unbound call at 3:20 (mutex_new), and again for mutex_destroy.
Reproduce with the Stage-A compiler built from compiler/bootstrap/flowc_stage_a.c:
cc -O2 -o compiler/build/flowc_bootstrap compiler/bootstrap/flowc_stage_a.c
FLOWC_BUNDLE=1 FLOWC_DIR=. FLOWC_IN=repro.flow FLOWC_OUT=repro.c compiler/build/flowc_bootstrap
cc -O0 -o repro repro.c -lm && ./repro; echo $?
The Python host (./flow test-lang) handles the same program correctly.
Found while porting the Python run tests to tests/lang/. The Python test stays until this is fixed: tests/unit/test_pthread_binding.py::test_the_stdlib_locks_are_at_least_as_large_as_the_objects_they_hold.
The second program in this issue passes m by value to mutex_destroy(m: ptr<Mutex>); with &m it runs. flowc's strict check does not flag the by-value argument (cc does), which is a separate checker gap.
Checked on main at ee5048d with the flowc built by compiler/scripts/bootstrap_from_c.sh --verify.
Reopening: my check above was wrong about strict mode. My harness dropped the --strict flag, so both runs were in the default lenient mode. Rechecked on main at ee5048d with the flag really passed:
$ compiler/scripts/flowc_emit.sh sizeof.flow sizeof.c && cc sizeof.c && ./a.out; echo $?
0
$ compiler/scripts/flowc_emit.sh --strict sizeof.flow sizeof.c
sizeof.flow:2:8: error: Undefined function 'sizeof_i64'
sizeof.flow:2:22: error: If condition must be bool, got i32
flowc emit: typecheck failed
stdlib/concurrent.flow mutex functions bind, in both modes.
changed the title [-]Stage-A: sizeof<T>() and stdlib/concurrent.flow mutex functions are unbound[/-][+]flowc strict check: sizeof<T>() is an undefined function (sizeof_i64)[/+]on Sep 30, 2026
Reproduced on main in strict mode: sizeof<i64>() gave "Undefined function 'sizeof_i64'". Lenient mode already worked. Fixed in #1082: sem_check types sizeof() as i64. The concurrent.flow program works on main when it passes &m. Passing m by value is now a strict error (#1080). Regression: tests/lang/test_sizeof_generic.flow.
Activity
fix(stage-a): know the complex builtins and sizeof<T>()
fix(stage-a): know the complex builtins and sizeof<T>()
godofecht commentedon Sep 30, 2026
Fixed on main (#966 added
compiler/fixtures/stage_a_sizeof.flow; stdlib module resolution landed with #1027). Both names bind now:The second program in this issue passes
mby value tomutex_destroy(m: ptr<Mutex>); with&mit runs. flowc's strict check does not flag the by-value argument (cc does), which is a separate checker gap.Checked on main at ee5048d with the flowc built by
compiler/scripts/bootstrap_from_c.sh --verify.godofecht commentedon Sep 30, 2026
Reopening: my check above was wrong about strict mode. My harness dropped the
--strictflag, so both runs were in the default lenient mode. Rechecked on main at ee5048d with the flag really passed:stdlib/concurrent.flowmutex functions bind, in both modes.sizeof<T>()works in the default mode but the strict checker (sem_check, selfhost: port the Python type checker to flowc (sem_check) with a parity gate #1071) rejects it: it looks up the monomorphized namesizeof_i64and types the call as i32../flow test-langruns strict, so the pthread size test still cannot move.[-]Stage-A: sizeof<T>() and stdlib/concurrent.flow mutex functions are unbound[/-][+]flowc strict check: sizeof<T>() is an undefined function (sizeof_i64)[/+]fix(flowc): path norm, sizeof builtin, struct→ptr, else-if hint
godofecht commentedon Sep 30, 2026
Reproduced on main in strict mode:
sizeof<i64>()gave "Undefined function 'sizeof_i64'". Lenient mode already worked. Fixed in #1082: sem_check types sizeof() as i64. The concurrent.flow program works on main when it passes&m. Passingmby value is now a strict error (#1080). Regression: tests/lang/test_sizeof_generic.flow.fix: strict checker types sizeof<T>() as i64 (#952)
fix: record sizeof<T>() as an intended py-only difference in the type…
fix: strict checker types sizeof<T>() as i64 (#952)
fix: record sizeof<T>() as an intended py-only difference in the type…
flowc: issues batch 4 (#1082)