Bug due to missing cast when doing $i[$x] = $z.

Added `math::iota`.
This commit is contained in:
Christoffer Lerno
2025-03-16 10:58:13 +01:00
parent 5c77c9a754
commit 425676a98d
4 changed files with 16 additions and 2 deletions

View File

@@ -1145,6 +1145,18 @@ macro overflow_mul_helper(x, y) @local
return res;
}
<*
@require types::is_vector($Type) || ($Type.kindof == ARRAY &&& types::is_numerical($typefrom($Type.inner)))
*>
macro iota($Type)
{
$Type $val = {};
$for var $i = 0; $i < $Type.len; $i++:
$val[$i] = $i;
$endfor
return $val;
}
macro mul_div_helper(val, mul, div) @private
{
var $Type = $typeof(val);