- Reference macro parameters syntax does not error in certain cases. #2612

This commit is contained in:
Christoffer Lerno
2025-11-30 02:23:00 +01:00
parent 9d79c3f33d
commit a2aa9fae6b
5 changed files with 22 additions and 7 deletions

View File

@@ -1,9 +1,9 @@
fn String str(int& element) // #error: Ref parameters are only allowed on methods
fn String str(int& element) // #error: Self parameters are only allowed on methods
{
return "abc";
}
fn String int.str(int& element) // #error: A ref parameter should always be untyped
fn String int.str(int& element) // #error: A self parameter should always be untyped, please remove the type here
{
return "abc";
}

View File

@@ -0,0 +1,11 @@
macro void m(&x) // #error: Self parameters are only allowed on methods
{
$echo $typeof(x);
}
fn void main()
{
int x;
m(x);
}