Fixed type unification for templates! Next up is adding to the scope for .

This commit is contained in:
Nathan Braswell
2018-12-07 01:08:12 -05:00
parent 3e6dc2c5ee
commit 3f2d51ba75
3 changed files with 14 additions and 17 deletions

View File

@@ -250,6 +250,14 @@ fun make_ast_binding(s: str): *tree<ast> {
fun make_ast_binding(s: str, v: vec<*binding<type>>): *tree<ast> {
return _binding(s, v, binding<tree<ast>>())
}
fun clone_ast_binding(binding: *tree<ast>): *tree<ast> {
match(binding->data) {
ast::_binding(b) {
return _binding(b.first, b.second, binding(b.third->bound_to))
}
}
error("trying to get binding on not a binding")
}
fun get_ast_binding_inst_types(binding: *tree<ast>): ref vec<*binding<type>> {
match(binding->data) {
ast::_binding(b) {