Fix this handling, other bytecode fixes

This commit is contained in:
Nathan Braswell
2018-03-21 00:00:06 -04:00
parent 91768a042e
commit 8edfd88c28
8 changed files with 64 additions and 53 deletions

View File

@@ -329,7 +329,7 @@ fun obj_lower(name_ast_map: *map<string, pair<*tree<symbol>,*ast_node>>, ast_to_
})
fun_to_obj.for_each(fun(method: *ast_node, object: *ast_node) {
var this_type = object->type_def.self_type->clone_with_increased_indirection()
var this_ident = ast_identifier_ptr("this", this_type, method)
var this_ident = method->function.this_param
method->function.parameters.add(0, this_ident)
add_to_scope("this", this_ident, method)
add_to_scope("~enclosing_scope", method, this_ident)