mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
@builtin was not respected for generic modules #1617.
This commit is contained in:
16
test/test_suite/generic/generic_builtin.c3t
Normal file
16
test/test_suite/generic/generic_builtin.c3t
Normal file
@@ -0,0 +1,16 @@
|
||||
module add(<Type>);
|
||||
fn Type add(Type a, Type b) @builtin =>
|
||||
a + b;
|
||||
|
||||
module iadd;
|
||||
fn int iadd(int a, int b) @builtin =>
|
||||
a + b;
|
||||
|
||||
module main;
|
||||
import std::io, add, iadd;
|
||||
|
||||
fn void! main()
|
||||
{
|
||||
io::printfn("%s", iadd(1,2)); // Fine
|
||||
io::printfn("%s", add(<int>)(1,2)); // Error
|
||||
}
|
||||
Reference in New Issue
Block a user