peon/tests/generics.pn

16 lines
229 B
Plaintext

operator `+`(a, b: int): int {
#pragma[magic: "AddInt64", pure]
}
operator `+`(a, b: int32): int32 {
#pragma[magic: "AddInt64", pure]
}
fn sum[T](a, b: T): T {
return a + b;
}
sum(1, 2);
sum(1'i32, 2'i32);