"@autoimport" attribute #366

This commit is contained in:
Christoffer Lerno
2022-01-18 23:09:30 +01:00
committed by Christoffer Lerno
parent 8adb0faa06
commit 556be2ff7f
7 changed files with 68 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
module foo;
fn int test() @autoimport
{
return 1;
}
macro int testm() @autoimport
{
return 1;
}
fn int test1()
{
return 1;
}
macro int testm1()
{
return 1;
}
module bar;
import foo;
fn void main()
{
@testm();
test();
}
fn void main2()
{
@testm1(); // #error: Macros from other modules must be prefixed with the module nam
test1(); // #error: Functions from other modules must be prefixed with the module nam
}

View File

@@ -14,7 +14,7 @@ module baz;
import bar;
fn void test()
{
@bar1();
@bar::bar1();
}
/* #expect: baz.ll