A little more work on function inference, fixed both Cephalapod and Kalypso's c generators to not accidentally emit this-> for a method param if the object has a var of the same name, which allows us to disambiguate with object_name::member = param_with_same_name, behavior I had not thought of but would have worked out of the box if not for this accidental bug

This commit is contained in:
Nathan Braswell
2016-02-09 02:59:38 -05:00
parent 9733a0be26
commit 2ac1639b5e
4 changed files with 45 additions and 14 deletions

View File

@@ -243,7 +243,7 @@ obj c_generator (Object) {
return to_ret
}
fun generate_identifier(node: *ast_node, enclosing_object: *ast_node): code_triple {
if (enclosing_object && get_ast_scope(enclosing_object)->contains_key(node->identifier.name))
if (enclosing_object && get_ast_scope(enclosing_object)->contains_key(node->identifier.name) && get_ast_scope(enclosing_object)->get(node->identifier.name).contains(node))
return code_triple("(this->") + node->identifier.name + ")"
return code_triple(node->identifier.name)
}