bare func declaration identities (comptime)

This commit is contained in:
2026-07-18 14:05:55 +02:00
parent 85693e57e1
commit e889a99e55
8 changed files with 512 additions and 74 deletions
+10 -4
View File
@@ -712,8 +712,10 @@
places, slicing, `.len`, `.ptr`, pointer captures, and pointer-param aliasing
- comptime storage pointers/slices cannot materialize as runtime memory; escaped
dead storage is rejected
- bare concrete non-comptime function names are values; native function pointer
types use `@func(...) R` and fallible `@func(...) R ! E`
- bare concrete non-comptime function names are comptime-only declaration identities;
native function pointer types use `@func(...) R` and fallible `@func(...) R ! E`
- bare identities implicitly materialize compatible runtime pointers, never the reverse;
aggregates containing bare identities remain comptime-only
- comptime-known native/bodyful `c_func` values can be called; bodyless/imported
callbacks remain runtime-only
- native function pointers are non-variadic v1; C variadic function pointers stay
@@ -914,12 +916,16 @@
- `isize` and `usize` remain concrete pointer-sized types
43. comptime function parameters (implemented)
- concrete native and C function values, function literals, and aggregates containing them
specialize by declaration identity rather than runtime address
- bare native and C function identities, function literals, and comptime-only aggregates
containing them specialize by declaration identity rather than runtime address
- repeated declarations reuse specializations, distinct declarations specialize separately, and
function-valued parameters remain erased from the runtime ABI
- statically known callback invocations lower to direct calls; runtime-selected function pointers
remain indirect, and bodyless C declarations remain runtime-only during comptime execution
- runtime pointer contexts implicitly materialize a bare identity; pointer-to-identity conversion is
rejected, and bare-containing aggregates cannot enter runtime storage or ABI/C layouts
44. struct field defaults on declaration
## A word on unchecked casts