@builtin was not respected for generic modules #1617.

This commit is contained in:
Christoffer Lerno
2024-11-13 23:34:34 +01:00
parent 61a76bb834
commit 7b516e6113
3 changed files with 18 additions and 1 deletions

View 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
}