2008-02-12 Jürg Billeter <j@bitron.ch>
+ * gobject/valaccodegenerator.vala: fix using instance methods as
+ delegates in the constructor
+
+2008-02-12 Jürg Billeter <j@bitron.ch>
+
* gobject/valaccodeassignmentbinding.vala: support signal handlers
with struct parameters
private int current_try_id = 0;
private int next_try_id = 0;
public bool in_creation_method = false;
+ private bool in_constructor = false;
private bool current_method_inner_error = false;
public DataType bool_type;
public override void visit_constructor (Constructor! c) {
current_method_inner_error = false;
+ in_constructor = true;
c.accept_children (this);
+ in_constructor = false;
+
var cl = (Class) c.parent_symbol;
function = new CCodeFunction ("%s_constructor".printf (cl.get_lower_case_cname (null)), "GObject *");
} else if (delegate_expr.symbol_reference is Method) {
var ma = (MemberAccess) delegate_expr;
if (ma.inner == null) {
- if (current_method != null && current_method.instance) {
+ if ((current_method != null && current_method.instance) || in_constructor) {
return new CCodeIdentifier ("self");
} else {
return new CCodeConstant ("NULL");