mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
"@autoimport" attribute #366
This commit is contained in:
committed by
Christoffer Lerno
parent
8adb0faa06
commit
556be2ff7f
36
test/test_suite/import/autoimport.c3
Normal file
36
test/test_suite/import/autoimport.c3
Normal 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
|
||||
}
|
||||
@@ -14,7 +14,7 @@ module baz;
|
||||
import bar;
|
||||
fn void test()
|
||||
{
|
||||
@bar1();
|
||||
@bar::bar1();
|
||||
}
|
||||
|
||||
/* #expect: baz.ll
|
||||
|
||||
Reference in New Issue
Block a user