Generic procedures generate types on use

This commit is contained in:
Ginger Bill committed 2017-06-25 19:41:07 +01:00
1 parent c4081393c1
commit 15dbea6899
6 files changed
+247 -171

No files matched your search

+9
View File
@@ -2,7 +2,15 @@ import (
"fmt.odin";
)
proc new_type(T: type) -> ^T {
return ^T(alloc_align(size_of(T), align_of(T)));
}
proc main() {
var ptr = new_type(int);
}
/*
let program = "+ + * - /";
var accumulator = 0;
@@ -18,4 +26,5 @@ proc main() {
fmt.printf("The program \"%s\" calculates the value %d\n",
program, accumulator);
*/
}