Add bitsizeof to Builtins (#2376)

* Add `bitsizeof` to Builtins

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
Zack Puhl
2025-08-06 07:55:39 -04:00
committed by GitHub
parent 6471728ee5
commit aae873c044
3 changed files with 24 additions and 0 deletions

View File

@@ -89,6 +89,10 @@ macro void @swap(#a, #b) @builtin
#b = temp;
}
macro usz bitsizeof($Type) @builtin @const => $Type.sizeof * 8u;
macro usz @bitsizeof(#expr) @builtin @const => $sizeof(#expr) * 8u;
<*
Convert an `any` type to a type, returning an failure if there is a type mismatch.