emitter: Adjust determine_left_type for more coverage.
@@ -1809,11 +1809,10 @@ static lily_type *determine_left_type(lily_emit_state *emit, lily_ast *ast)
}
}
else if (ast->tree_type == tree_oo_access) {
- result_type = determine_left_type(emit, ast->arg_start);
- if (result_type != NULL) {
+ lily_type *lookup_type = determine_left_type(emit, ast->arg_start);
+ if (lookup_type != NULL) {
char *oo_name = lily_sp_get(emit->expr_strings, ast->pile_pos);
- lily_class *lookup_class = result_type->cls;
- lily_type *lookup_type = result_type;
+ lily_class *lookup_class = lookup_type->cls;
lily_prop_entry *prop = lily_find_property(lookup_class, oo_name);
@@ -1824,15 +1823,11 @@ static lily_type *determine_left_type(lily_emit_state *emit, lily_ast *ast)
lookup_type, result_type);
}
}
- else
- result_type = NULL;
}
}
else if (ast->tree_type == tree_property)
result_type = ast->property->type;
/* All other are either invalid for the left side of an assignment. */
- else
- result_type = NULL;
return result_type;
}
