mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- x'1234' +++ (ichar[1]) { 'A' } would fail due to missing const folding.
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
- Assert when encountering a malformed module alias.
|
- Assert when encountering a malformed module alias.
|
||||||
- Assert when encountering a test function with raw vaarg parameters.
|
- Assert when encountering a test function with raw vaarg parameters.
|
||||||
- `foo.x` was not always handled correctly when `foo` was optional.
|
- `foo.x` was not always handled correctly when `foo` was optional.
|
||||||
|
- `x'1234' +++ (ichar[1]) { 'A' }` would fail due to missing const folding.
|
||||||
|
|
||||||
### Stdlib changes
|
### Stdlib changes
|
||||||
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
|
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
|
||||||
|
|||||||
@@ -187,6 +187,10 @@ static bool sema_concat_bytes_and_other(SemaContext *context, Expr *expr, Expr *
|
|||||||
case CONST_SLICE:
|
case CONST_SLICE:
|
||||||
case CONST_INITIALIZER:
|
case CONST_INITIALIZER:
|
||||||
if (!cast_implicit(context, right, type_get_inferred_array(indexed), false)) return false;
|
if (!cast_implicit(context, right, type_get_inferred_array(indexed), false)) return false;
|
||||||
|
if (!sema_cast_const(right))
|
||||||
|
{
|
||||||
|
RETURN_SEMA_ERROR(right, "Could not concatenate with the right hand side.");
|
||||||
|
}
|
||||||
expr_contract_array(&right->const_expr, left->const_expr.const_kind);
|
expr_contract_array(&right->const_expr, left->const_expr.const_kind);
|
||||||
goto RETRY;
|
goto RETRY;
|
||||||
}
|
}
|
||||||
|
|||||||
5
test/test_suite/compile_time/concat_convert.c3
Normal file
5
test/test_suite/compile_time/concat_convert.c3
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
fn int main()
|
||||||
|
{
|
||||||
|
const A = x'1234' +++ (ichar[1]) { 'A' };
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user