Files
c3c/test/test_suite/macros/macro_with_body_err.c3
Christoffer Lerno 37bb16cca1 Updated cast code.
2023-09-12 12:48:52 +02:00

33 lines
439 B
C

module withbody;
extern fn int printf(char *, ...);
struct Foo
{
int x;
}
fn int Foo.mutate(Foo *foo)
{
printf("Mutating\n");
return 10 * ++foo.x;
}
macro @macro_with_body(foo, &x; @body(x, y))
{
*x = foo.x;
@body(foo.mutate(), x); // #error: 'int*' to 'int'
}
fn void main()
{
Foo f = { 33 };
int y;
@macro_with_body(f, y; int x, int dy)
{
printf("Got values %d, %d\n", x, dy);
};
}