Check pointer/slice/etc on [out] and & params. #2156.

This commit is contained in:
Christoffer Lerno
2025-05-27 23:03:32 +02:00
parent b665e2cbe5
commit be3f9007c9
4 changed files with 54 additions and 28 deletions

View File

@@ -0,0 +1,12 @@
import std;
<*
@param [&out] x
@require $defined(*x) : "x must be a pointer"
*>
macro foo(x) => *x = 1;
fn int main()
{
foo(0); // #error: Expected a pointer
return 0;
}