+2009-01-10 Jürg Billeter <j@bitron.ch>
+
+ * gobject/valaccodebasemodule.vala:
+ * gobject/valaccodedelegatemodule.vala:
+
+ Fix critical and generated code for static delegate fields,
+ fixes bug 563016
+
2009-01-10 Jürg Billeter <j@bitron.ch>
* vala/valafield.vala:
}
public CCodeExpression? default_value_for_type (DataType type, bool initializer_expression) {
- if ((type.data_type != null && type.data_type.is_reference_type ()) || type is PointerType || type is ArrayType) {
+ if ((type.data_type != null && type.data_type.is_reference_type ())
+ || type is PointerType || type is ArrayType || type is DelegateType) {
return new CCodeConstant ("NULL");
} else if (type.data_type != null && type.data_type.get_default_value () != null) {
return new CCodeConstant (type.data_type.get_default_value ());
/* valaccodedelegatemodule.vala
*
- * Copyright (C) 2006-2008 Jürg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2009 Jürg Billeter
+ * Copyright (C) 2006-2008 Raffaele Sandrini
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
var ma = (MemberAccess) delegate_expr;
- var base_type = ma.inner.value_type;
CCodeExpression target_expr = null;
- var pub_inst = (CCodeExpression) get_ccodenode (ma.inner);
-
if (field.binding == MemberBinding.INSTANCE) {
- var instance_expression_type = base_type;
+ var instance_expression_type = ma.inner.value_type;
var instance_target_type = get_data_type_for_symbol ((TypeSymbol) field.parent_symbol);
+
+ var pub_inst = (CCodeExpression) get_ccodenode (ma.inner);
CCodeExpression typed_inst = transform_expression (pub_inst, instance_expression_type, instance_target_type);
CCodeExpression inst;