Polymorphic function
This commit is contained in:
parent
4bfbd5ded5
commit
fab147eacc
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
|||||||
struct SimplePolymorphic[$T] {
|
struct SimplePolymorphic'$T' {
|
||||||
member: T,
|
member: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn[cc(.c)] main[export]() s32 {
|
fn[cc(.c)] main[export]() s32 {
|
||||||
>s: SimplePolymorphic[s32] = {
|
>s: SimplePolymorphic's32' = {
|
||||||
.member = 0,
|
.member = 0,
|
||||||
};
|
};
|
||||||
return s.member;
|
return s.member;
|
||||||
|
7
retest/standalone/polymorphic_function/main.nat
Normal file
7
retest/standalone/polymorphic_function/main.nat
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fn polymorphic'$T'(arg: T) T {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn[cc(.c)] main[export]() s32 {
|
||||||
|
return polymorphic's32'(0);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user