Files
c3c/test/test_suite/contracts/in_out.c3
Christoffer Lerno 3da9f73338 - Output into /.build/obj/<platform> by default.
- Output llvm/asm into llvm/<platform> and asm/<platform> by default.
- Don't delete .o files not produced by the compiler.
- Correctly handle in/out when interacting with inout.
2025-02-22 22:34:26 +01:00

23 lines
330 B
Plaintext

struct Foo { int x; }
<* @param [out] f *>
fn void bar(Foo* f)
{
f.x = 123;
}
<* @param [in] f *>
fn void foo(Foo* f)
{
bar(f); // #error: An 'in' parameter may not be passed i
}
<* @param [in] f *>
fn void foo2(Foo* f)
{
}
<* @param [out] f *>
fn void baz(Foo *f)
{
foo2(f); // #error: may not be passed into a function
}