diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-18 20:39:42 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-18 20:39:42 -0500 |
commit | c1b40edd57e3474925e620c63d781bf8bf40f5b6 (patch) | |
tree | b91547e9c06e9ae03da0dc6ebca5942f31d93fab | |
parent | 47ad1b1ce212ba1131480df28bec9480b7403340 (diff) |
stuff with type params
-rw-r--r-- | decls_cgen.c | 5 | ||||
-rw-r--r-- | main.c | 1 | ||||
-rw-r--r-- | test.toc | 12 |
3 files changed, 11 insertions, 7 deletions
diff --git a/decls_cgen.c b/decls_cgen.c index ad547ee..19eb0bc 100644 --- a/decls_cgen.c +++ b/decls_cgen.c @@ -10,7 +10,10 @@ static bool cgen_decls_fn_instances(CGenerator *g, Expression *e) { Instance **data = f->instances.data; for (U64 i = 0; i < f->instances.cap; i++) { if (f->instances.occupied[i]) { - if (!cgen_fn_header(g, f, e->where, (*data)->c.id, (*data)->val.tuple[0].u64)) + (*data)->fn.c.name = f->c.name; + (*data)->fn.c.id = f->c.id; + + if (!cgen_fn_header(g, &(*data)->fn, e->where, (*data)->c.id, (*data)->val.tuple[0].u64)) return false; cgen_write(g, ";"); cgen_nl(g); @@ -1,6 +1,7 @@ /* TODO: deal with typing functions with type parameters (we need to type every single instance) +do typedefs for each instance struct parameters don't allow while {3; 5} (once break is added) @@ -9,10 +9,10 @@ puti @= fn(x: int) { -main @= fn() { - puti(f(17)); -}; +// main @= fn() { +// puti(f(17)); +// }; -f @= fn(k @ int) int { -k -};
\ No newline at end of file +// f @= fn(k @ int) int { +// k +// };
\ No newline at end of file |