mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Bug due to missing cast when doing $i[$x] = $z.
Added `math::iota`.
This commit is contained in:
@@ -633,7 +633,7 @@ module std::core::mem;
|
||||
macro TrackingEnv* get_tracking_env()
|
||||
{
|
||||
$if env::TRACK_MEMORY:
|
||||
return &&TrackingEnv { $$FILE, $$FUNC, $$LINE };
|
||||
return &&(TrackingEnv){ $$FILE, $$FUNC, $$LINE };
|
||||
$else
|
||||
return null;
|
||||
$endif
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
- `import` can now both be @public and @norecurse.
|
||||
- Crash when trying to convert a struct slice to a vector #2039.
|
||||
- Crash resolving a method on `Foo[2]` when `Foo` is distinct #2042.
|
||||
- Bug due to missing cast when doing `$i[$x] = $z`.
|
||||
|
||||
### Stdlib changes
|
||||
- `new_*` functions in general moved to version without `new_` prefix.
|
||||
@@ -61,6 +62,7 @@
|
||||
- Change all hash functions to have a common `hash` function.
|
||||
- `@wstring`, `@wstring32`, `@char32` and `@char16` compile time macros added.
|
||||
- Updates to `Atomic` to handle distinct types and booleans.
|
||||
- Added `math::iota`.
|
||||
|
||||
## 0.6.8 Change list
|
||||
|
||||
|
||||
@@ -5745,7 +5745,7 @@ static bool sema_expr_analyse_ct_subscript_rhs(SemaContext *context, Decl *ct_va
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sema_analyse_inferred_expr(context, type_get_indexed_type(ct_var->type), right)) return false;
|
||||
if (!sema_analyse_expr_rhs(context, type_get_indexed_type(ct_var->type), right, false, NULL, false)) return false;
|
||||
}
|
||||
if (!sema_cast_const(right))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user