- Inlining a const as an lvalue would take the wrong path and corrupt the expression node.

This commit is contained in:
Christoffer Lerno
2025-08-25 15:26:47 +02:00
parent f43a7540c5
commit bc9b0900a5
3 changed files with 23 additions and 1 deletions

View File

@@ -66,6 +66,7 @@
- Lambdas on the top level were not exported by default. #2428
- `has_tagof` on tagged lambdas returns false #2432
- Properly add "inlined at" for generic instantiation errors #2382.
- Inlining a const as an lvalue would take the wrong path and corrupt the expression node.
### Stdlib changes
- Add `==` to `Pair`, `Triple` and TzDateTime. Add print to `Pair` and `Triple`.

View File

@@ -11315,7 +11315,7 @@ RETRY:
goto IDENT_CHECK;
case EXPR_UNRESOLVED_IDENTIFIER:
if (!sema_analyse_expr_dispatch(context, expr, CHECK_VALUE)) return false;
FALLTHROUGH;
goto RETRY;
case EXPR_IDENTIFIER:
IDENT_CHECK:;
{

View File

@@ -0,0 +1,21 @@
module testi;
macro @foo(#x)
{
#x *= 2; // #error: You cannot assign to a constant expression
}
attrdef @On_Start(x) = @tag("on_start", @foo(x));
fn void some() @On_Start(fn void(int a) { ; })
{
}
fn int main() => main2();
macro main2()
{
some.tagof("on_start")(1);
some();
return 0;
}