mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Reference macro parameters syntax does not error in certain cases. #2612
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
11
test/test_suite/methods/self_not_method.c3
Normal file
11
test/test_suite/methods/self_not_method.c3
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user