Rename Property.type_reference to Property.property_type
authorJuerg Billeter <j@bitron.ch>
Tue, 13 May 2008 09:05:32 +0000 (09:05 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 13 May 2008 09:05:32 +0000 (09:05 +0000)
2008-05-13  Juerg Billeter  <j@bitron.ch>

* vala/valaclass.vala:
* vala/valainterfacewriter.vala:
* vala/valamemorymanager.vala:
* vala/valaproperty.vala:
* vala/valasemanticanalyzer.vala:
* gobject/valaccodeassignmentbinding.vala:
* gobject/valaccodeclassbinding.vala:
* gobject/valaccodegenerator.vala:
* gobject/valaccodememberaccessbinding.vala:
* gobject/valaccodetypesymbolbinding.vala:
* gobject/valagidlwriter.vala:

Rename Property.type_reference to Property.property_type

svn path=/trunk/; revision=1389

12 files changed:
ChangeLog
gobject/valaccodeassignmentbinding.vala
gobject/valaccodeclassbinding.vala
gobject/valaccodegenerator.vala
gobject/valaccodememberaccessbinding.vala
gobject/valaccodetypesymbolbinding.vala
gobject/valagidlwriter.vala
vala/valaclass.vala
vala/valainterfacewriter.vala
vala/valamemorymanager.vala
vala/valaproperty.vala
vala/valasemanticanalyzer.vala

index 55f87ef..f3d4261 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2008-05-13  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valaclass.vala:
+       * vala/valainterfacewriter.vala:
+       * vala/valamemorymanager.vala:
+       * vala/valaproperty.vala:
+       * vala/valasemanticanalyzer.vala:
+       * gobject/valaccodeassignmentbinding.vala:
+       * gobject/valaccodeclassbinding.vala:
+       * gobject/valaccodegenerator.vala:
+       * gobject/valaccodememberaccessbinding.vala:
+       * gobject/valaccodetypesymbolbinding.vala:
+       * gobject/valagidlwriter.vala:
+
+       Rename Property.type_reference to Property.property_type
+
+2008-05-13  Jürg Billeter  <j@bitron.ch>
+
        * vala/valadelegate.vala:
        * vala/valaformalparameter.vala:
        * vala/valainterfacewriter.vala:
index cfcd6c8..27acef5 100644 (file)
@@ -41,15 +41,15 @@ public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
                var prop = (Property) assignment.left.symbol_reference;
 
                if (prop.set_accessor.construction && codegen.current_type_symbol is Class && codegen.current_class.is_subtype_of (codegen.gobject_type) && codegen.in_creation_method) {
-                       codenode = get_construct_property_assignment (prop.get_canonical_cconstant (), prop.type_reference, (CCodeExpression) assignment.right.ccodenode);
+                       codenode = get_construct_property_assignment (prop.get_canonical_cconstant (), prop.property_type, (CCodeExpression) assignment.right.ccodenode);
                } else {
                        CCodeExpression cexpr = (CCodeExpression) assignment.right.ccodenode;
 
                        // ensure to pass the value correctly typed (especially important for varargs)
-                       cexpr = codegen.get_implicit_cast_expression (cexpr, assignment.right.value_type, prop.type_reference);
+                       cexpr = codegen.get_implicit_cast_expression (cexpr, assignment.right.value_type, prop.property_type);
 
                        if (!prop.no_accessor_method) {
-                               if (prop.type_reference.is_real_struct_type ()) {
+                               if (prop.property_type.is_real_struct_type ()) {
                                        cexpr = codegen.get_address_of_expression (assignment.right, cexpr);
                                }
                        }
index 1830636..28c73d0 100644 (file)
@@ -419,7 +419,7 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                        var props = cl.get_properties ();
                        foreach (Property prop in props) {
                                // FIXME: omit real struct types for now since they cannot be expressed as gobject property yet
-                               if (prop.type_reference.is_real_struct_type ()) {
+                               if (prop.property_type.is_real_struct_type ()) {
                                        continue;
                                }
                                if (prop.access == SymbolAccessibility.PRIVATE) {
@@ -601,7 +601,7 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                var props = cl.get_properties ();
                foreach (Property prop in props) {
                        // FIXME: omit real struct types for now since they cannot be expressed as gobject property yet
-                       if (prop.get_accessor == null || prop.is_abstract || prop.type_reference.is_real_struct_type ()) {
+                       if (prop.get_accessor == null || prop.is_abstract || prop.property_type.is_real_struct_type ()) {
                                continue;
                        }
                        if (prop.access == SymbolAccessibility.PRIVATE) {
@@ -620,7 +620,7 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                        var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_get_%s".printf (prefix, prop.name)));
                        ccall.add_argument (new CCodeIdentifier ("self"));
                        var csetcall = new CCodeFunctionCall ();
-                       csetcall.call = get_value_setter_function (prop.type_reference);
+                       csetcall.call = get_value_setter_function (prop.property_type);
                        csetcall.add_argument (new CCodeIdentifier ("value"));
                        csetcall.add_argument (ccall);
                        ccase.add_statement (new CCodeExpressionStatement (csetcall));
@@ -656,7 +656,7 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                var props = cl.get_properties ();
                foreach (Property prop in props) {
                        // FIXME: omit real struct types for now since they cannot be expressed as gobject property yet
-                       if (prop.set_accessor == null || prop.is_abstract || prop.type_reference.is_real_struct_type ()) {
+                       if (prop.set_accessor == null || prop.is_abstract || prop.property_type.is_real_struct_type ()) {
                                continue;
                        }
                        if (prop.access == SymbolAccessibility.PRIVATE) {
@@ -675,8 +675,8 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                        var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_set_%s".printf (prefix, prop.name)));
                        ccall.add_argument (new CCodeIdentifier ("self"));
                        var cgetcall = new CCodeFunctionCall ();
-                       if (prop.type_reference.data_type != null) {
-                               cgetcall.call = new CCodeIdentifier (prop.type_reference.data_type.get_get_value_function ());
+                       if (prop.property_type.data_type != null) {
+                               cgetcall.call = new CCodeIdentifier (prop.property_type.data_type.get_get_value_function ());
                        } else {
                                cgetcall.call = new CCodeIdentifier ("g_value_get_pointer");
                        }
index 7271dba..3029340 100644 (file)
@@ -746,7 +746,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
 
                // FIXME: omit real struct types for now since they cannot be expressed as gobject property yet
                // don't register private properties
-               if (prop.parent_symbol is Class && !prop.type_reference.is_real_struct_type () && prop.access != SymbolAccessibility.PRIVATE) {
+               if (prop.parent_symbol is Class && !prop.property_type.is_real_struct_type () && prop.access != SymbolAccessibility.PRIVATE) {
                        prop_enum.add_value (new CCodeEnumValue (prop.get_upper_case_cname ()));
                }
        }
@@ -757,10 +757,10 @@ public class Vala.CCodeGenerator : CodeGenerator {
 
                var prop = (Property) acc.prop;
 
-               bool returns_real_struct = prop.type_reference.is_real_struct_type ();
+               bool returns_real_struct = prop.property_type.is_real_struct_type ();
 
                if (acc.readable && !returns_real_struct) {
-                       current_return_type = prop.type_reference;
+                       current_return_type = prop.property_type;
                } else {
                        current_return_type = new VoidType ();
                }
@@ -778,13 +778,13 @@ public class Vala.CCodeGenerator : CodeGenerator {
                        this_type = new InterfaceInstanceType ((Interface) t);
                }
                var cselfparam = new CCodeFormalParameter ("self", this_type.get_cname ());
-               var value_type = prop.type_reference.copy ();
+               var value_type = prop.property_type.copy ();
                value_type.takes_ownership = value_type.transfers_ownership;
                var cvalueparam = new CCodeFormalParameter ("value", value_type.get_cname ());
 
                if (prop.is_abstract || prop.is_virtual) {
                        if (acc.readable) {
-                               function = new CCodeFunction ("%s_get_%s".printf (t.get_lower_case_cname (null), prop.name), prop.type_reference.get_cname ());
+                               function = new CCodeFunction ("%s_get_%s".printf (t.get_lower_case_cname (null), prop.name), prop.property_type.get_cname ());
                        } else {
                                function = new CCodeFunction ("%s_set_%s".printf (t.get_lower_case_cname (null), prop.name), "void");
                        }
@@ -806,7 +806,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
 
                        if (acc.readable) {
                                // declare temporary variable to save the property value
-                               var decl = new CCodeDeclaration (prop.type_reference.get_cname ());
+                               var decl = new CCodeDeclaration (prop.property_type.get_cname ());
                                decl.add_declarator (new CCodeVariableDeclarator ("value"));
                                block.add_statement (decl);
                        
@@ -826,9 +826,9 @@ public class Vala.CCodeGenerator : CodeGenerator {
                                block.add_statement (new CCodeExpressionStatement (ccall));
 
                                // HACK: decrement the refcount before returning the value to simulate a weak reference getter function
-                               if (prop.type_reference.data_type != null && prop.type_reference.data_type.is_reference_counting ()) {
+                               if (prop.property_type.data_type != null && prop.property_type.data_type.is_reference_counting ()) {
                                        var unref_cond = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, new CCodeIdentifier ("value"), new CCodeConstant ("NULL"));
-                                       var unref_function = new CCodeFunctionCall (get_destroy_func_expression (prop.type_reference));
+                                       var unref_function = new CCodeFunctionCall (get_destroy_func_expression (prop.property_type));
                                        unref_function.add_argument (new CCodeIdentifier ("value"));
                                        var unref_block = new CCodeBlock ();
                                        unref_block.add_statement (new CCodeExpressionStatement (unref_function));
@@ -868,7 +868,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
                                        // return non simple structs as out parameter
                                        function = new CCodeFunction ("%s_get_%s".printf (prefix, prop.name), "void");
                                } else {
-                                       function = new CCodeFunction ("%s_get_%s".printf (prefix, prop.name), prop.type_reference.get_cname ());
+                                       function = new CCodeFunction ("%s_get_%s".printf (prefix, prop.name), prop.property_type.get_cname ());
                                }
                        } else {
                                function = new CCodeFunction ("%s_set_%s".printf (prefix, prop.name), "void");
@@ -879,7 +879,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
                        function.add_parameter (cselfparam);
                        if (returns_real_struct) {
                                // return non simple structs as out parameter
-                               var coutparamname = "%s*".printf (prop.type_reference.get_cname ());
+                               var coutparamname = "%s*".printf (prop.property_type.get_cname ());
                                var coutparam = new CCodeFormalParameter ("value", coutparamname);
                                function.add_parameter (coutparam);
                        } else {
@@ -2283,7 +2283,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
                        // paramenter and insert an empty return statement afterwards.
                        if (current_property_accessor != null &&
                            current_property_accessor.readable &&
-                           current_property_accessor.prop.type_reference.is_real_struct_type()) {
+                           current_property_accessor.prop.property_type.is_real_struct_type()) {
                                var cfragment = new CCodeFragment ();
                                cfragment.append (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("*value"), (CCodeExpression) stmt.return_expression.ccodenode)));
                                cfragment.append (new CCodeReturnStatement ());
@@ -2768,7 +2768,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
                        var ccomma = new CCodeCommaExpression ();
                        
                        // assign current value to temp variable
-                       var temp_decl = get_temp_variable (prop.type_reference, true, expr);
+                       var temp_decl = get_temp_variable (prop.property_type, true, expr);
                        temp_vars.insert (0, temp_decl);
                        ccomma.append_expression (new CCodeAssignment (new CCodeIdentifier (temp_decl.name), (CCodeExpression) expr.inner.ccodenode));
                        
@@ -3703,7 +3703,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
        
        private CCodeStatement create_property_type_check_statement (Property prop, bool check_return_type, Typesymbol t, bool non_null, string var_name) {
                if (check_return_type) {
-                       return create_type_check_statement (prop, prop.type_reference, t, non_null, var_name);
+                       return create_type_check_statement (prop, prop.property_type, t, non_null, var_name);
                } else {
                        return create_type_check_statement (prop, new VoidType (), t, non_null, var_name);
                }
index 0d79a0f..ef1408c 100644 (file)
@@ -141,9 +141,9 @@ public class Vala.CCodeMemberAccessBinding : CCodeExpressionBinding {
 
                                // Property acesses to real struct types are handeled different to other properties.
                                // They are returned as out parameter.
-                               if (base_property.type_reference.is_real_struct_type ()) {
+                               if (base_property.property_type.is_real_struct_type ()) {
                                        var ccomma = new CCodeCommaExpression ();
-                                       var temp_var = codegen.get_temp_variable (base_property.type_reference);
+                                       var temp_var = codegen.get_temp_variable (base_property.property_type);
                                        var ctemp = new CCodeIdentifier (temp_var.name);
                                        codegen.temp_vars.add (temp_var);
                                        ccall.add_argument (new CCodeUnaryExpression(CCodeUnaryOperator.ADDRESS_OF, ctemp));
@@ -201,7 +201,7 @@ public class Vala.CCodeMemberAccessBinding : CCodeExpressionBinding {
                                        if (codegen.current_property_accessor != null &&
                                            codegen.current_property_accessor.writable &&
                                            codegen.current_property_accessor.value_parameter == p &&
-                                           codegen.current_property_accessor.prop.type_reference.is_real_struct_type ()) {
+                                           codegen.current_property_accessor.prop.property_type.is_real_struct_type ()) {
                                                expr.ccodenode = new CCodeIdentifier ("(*value)");
                                        } else {
                                                expr.ccodenode = new CCodeIdentifier (p.name);
index 360b5ce..bf1fa72 100644 (file)
@@ -29,14 +29,14 @@ public abstract class Vala.CCodeTypesymbolBinding : CCodeBinding {
                cspec.add_argument (prop.get_canonical_cconstant ());
                cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.nick)));
                cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.blurb)));
-               if ((prop.type_reference.data_type is Class && ((Class) prop.type_reference.data_type).is_subtype_of (codegen.gobject_type)) || prop.type_reference.data_type is Interface) {
+               if ((prop.property_type.data_type is Class && ((Class) prop.property_type.data_type).is_subtype_of (codegen.gobject_type)) || prop.property_type.data_type is Interface) {
                        cspec.call = new CCodeIdentifier ("g_param_spec_object");
-                       cspec.add_argument (new CCodeIdentifier (prop.type_reference.data_type.get_upper_case_cname ("TYPE_")));
-               } else if (prop.type_reference.data_type == codegen.string_type.data_type) {
+                       cspec.add_argument (new CCodeIdentifier (prop.property_type.data_type.get_upper_case_cname ("TYPE_")));
+               } else if (prop.property_type.data_type == codegen.string_type.data_type) {
                        cspec.call = new CCodeIdentifier ("g_param_spec_string");
                        cspec.add_argument (new CCodeConstant ("NULL"));
-               } else if (prop.type_reference.data_type is Enum) {
-                       var e = prop.type_reference.data_type as Enum;
+               } else if (prop.property_type.data_type is Enum) {
+                       var e = prop.property_type.data_type as Enum;
                        if (e.has_type_id) {
                                if (e.is_flags) {
                                        cspec.call = new CCodeIdentifier ("g_param_spec_flags");
@@ -59,10 +59,10 @@ public abstract class Vala.CCodeTypesymbolBinding : CCodeBinding {
                        if (prop.default_expression != null) {
                                cspec.add_argument ((CCodeExpression) prop.default_expression.ccodenode);
                        } else {
-                               cspec.add_argument (new CCodeConstant (prop.type_reference.data_type.get_default_value ()));
+                               cspec.add_argument (new CCodeConstant (prop.property_type.data_type.get_default_value ()));
                        }
-               } else if (prop.type_reference.data_type is Struct) {
-                       var st = (Struct) prop.type_reference.data_type;
+               } else if (prop.property_type.data_type is Struct) {
+                       var st = (Struct) prop.property_type.data_type;
                        if (st.get_type_id () == "G_TYPE_INT") {
                                cspec.call = new CCodeIdentifier ("g_param_spec_int");
                                cspec.add_argument (new CCodeConstant ("G_MININT"));
index e772a97..a6127d9 100644 (file)
@@ -432,7 +432,7 @@ public class Vala.GIdlWriter : CodeVisitor {
                }
 
                write_indent ();
-               stream.printf ("<property name=\"%s\" type=\"%s\"", prop.name, get_gidl_type_name (prop.type_reference));
+               stream.printf ("<property name=\"%s\" type=\"%s\"", prop.name, get_gidl_type_name (prop.property_type));
                if (prop.get_accessor != null) {
                        stream.printf (" readable=\"1\"");
                }
index b77bdc4..15e7db5 100644 (file)
@@ -286,7 +286,7 @@ public class Vala.Class : Typesymbol {
 
                        if (empty_get && empty_set) {
                                /* automatic property accessor body generation */
-                               var field_type = prop.type_reference.copy ();
+                               var field_type = prop.property_type.copy ();
                                var f = new Field ("_%s".printf (prop.name), field_type, prop.default_expression, prop.source_reference);
                                f.access = SymbolAccessibility.PRIVATE;
                                prop.field = f;
index 7a7e99a..5fc14bf 100644 (file)
@@ -733,13 +733,13 @@ public class Vala.InterfaceWriter : CodeVisitor {
                } else if (prop.is_virtual) {
                        write_string ("virtual ");
                }
-               if (!prop.type_reference.takes_ownership) {
+               if (!prop.property_type.takes_ownership) {
                        write_string ("weak ");
                }
 
-               write_type (prop.type_reference);
+               write_type (prop.property_type);
 
-               if (prop.type_reference.transfers_ownership) {
+               if (prop.property_type.transfers_ownership) {
                        write_string ("#");
                }
 
index 1a2f3f5..58f3575 100644 (file)
@@ -189,7 +189,7 @@ public class Vala.MemoryManager : CodeVisitor {
                        } else if (current_symbol is Property) {
                                /* property get accessor */
                                var prop = (Property) current_symbol;
-                               if (prop.type_reference.transfers_ownership) {
+                               if (prop.property_type.transfers_ownership) {
                                        visit_possibly_missing_copy_expression (stmt.return_expression);
                                } else {
                                        visit_possibly_leaked_expression (stmt.return_expression);
index 1b3035c..884c8bb 100644 (file)
@@ -29,7 +29,7 @@ public class Vala.Property : Member, Lockable {
        /**
         * The property type.
         */
-       public DataType type_reference {
+       public DataType property_type {
                get { return _data_type; }
                set {
                        _data_type = value;
@@ -160,12 +160,12 @@ public class Vala.Property : Member, Lockable {
         * @param source       reference to source code
         * @return             newly created property
         */
-       public Property (string _name, DataType type, PropertyAccessor? _get_accessor, PropertyAccessor? _set_accessor, SourceReference source) {
-               name = _name;
-               type_reference = type;
-               get_accessor = _get_accessor;
-               set_accessor = _set_accessor;
-               source_reference = source;
+       public Property (string name, DataType property_type, PropertyAccessor? get_accessor, PropertyAccessor? set_accessor, SourceReference source_reference) {
+               this.name = name;
+               this.property_type = property_type;
+               this.get_accessor = get_accessor;
+               this.set_accessor = set_accessor;
+               this.source_reference = source_reference;
        }
 
        public override void accept (CodeVisitor visitor) {
@@ -175,7 +175,7 @@ public class Vala.Property : Member, Lockable {
        }
 
        public override void accept_children (CodeVisitor visitor) {
-               type_reference.accept (visitor);
+               property_type.accept (visitor);
                
                if (get_accessor != null) {
                        get_accessor.accept (visitor);
@@ -265,7 +265,7 @@ public class Vala.Property : Member, Lockable {
         *             property
         */
        public bool equals (Property prop2) {
-               if (!prop2.type_reference.equals (type_reference)) {
+               if (!prop2.property_type.equals (property_type)) {
                        return false;
                }
 
@@ -292,8 +292,8 @@ public class Vala.Property : Member, Lockable {
        }
 
        public override void replace_type (DataType old_type, DataType new_type) {
-               if (type_reference == old_type) {
-                       type_reference = new_type;
+               if (property_type == old_type) {
+                       property_type = new_type;
                }
        }
 }
index 1c3b812..f781708 100644 (file)
@@ -654,9 +654,9 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                prop.accept_children (this);
 
                // check whether property type is at least as accessible as the property
-               if (!is_type_accessible (prop, prop.type_reference)) {
+               if (!is_type_accessible (prop, prop.property_type)) {
                        prop.error = true;
-                       Report.error (prop.source_reference, "property type `%s` is less accessible than property `%s`".printf (prop.type_reference.to_string (), prop.get_full_name ()));
+                       Report.error (prop.source_reference, "property type `%s` is less accessible than property `%s`".printf (prop.property_type.to_string (), prop.get_full_name ()));
                        return;
                }
 
@@ -667,21 +667,21 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                 * Reference counting types can simulate to return a weak
                 * reference */
                if ((prop.is_abstract || prop.is_virtual) &&
-                   prop.type_reference.data_type != null &&
-                   prop.type_reference.data_type.is_reference_type () &&
-                   !prop.type_reference.data_type.is_reference_counting () &&
-                   !prop.type_reference.transfers_ownership)
+                   prop.property_type.data_type != null &&
+                   prop.property_type.data_type.is_reference_type () &&
+                   !prop.property_type.data_type.is_reference_counting () &&
+                   !prop.property_type.transfers_ownership)
                {
-                       Report.error (prop.source_reference, "%s: abstract or virtual properties using reference types not supporting reference counting, like `%s', have to mark their return value to transfer ownership.".printf (prop.get_full_name (), prop.type_reference.data_type.get_full_name ()));
+                       Report.error (prop.source_reference, "%s: abstract or virtual properties using reference types not supporting reference counting, like `%s', have to mark their return value to transfer ownership.".printf (prop.get_full_name (), prop.property_type.data_type.get_full_name ()));
                        prop.error = true;
                }
 
                current_symbol = current_symbol.parent_symbol;
 
                if (!prop.is_internal_symbol ()) {
-                       current_source_file.add_type_dependency (prop.type_reference, SourceFileDependencyType.HEADER_SHALLOW);
+                       current_source_file.add_type_dependency (prop.property_type, SourceFileDependencyType.HEADER_SHALLOW);
                }
-               current_source_file.add_type_dependency (prop.type_reference, SourceFileDependencyType.SOURCE);
+               current_source_file.add_type_dependency (prop.property_type, SourceFileDependencyType.SOURCE);
 
                if (prop.parent_symbol is Class) {
                        var cl = (Class) prop.parent_symbol;
@@ -712,7 +712,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                acc.prop = (Property) current_symbol;
 
                if (acc.readable) {
-                       current_return_type = acc.prop.type_reference;
+                       current_return_type = acc.prop.property_type;
                } else {
                        // void
                        current_return_type = new VoidType ();
@@ -739,7 +739,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        }
 
                        if (acc.body != null && (acc.writable || acc.construction)) {
-                               var value_type = acc.prop.type_reference.copy ();
+                               var value_type = acc.prop.property_type.copy ();
                                value_type.takes_ownership = value_type.transfers_ownership;
                                acc.value_parameter = new FormalParameter ("value", value_type, acc.source_reference);
                                acc.body.scope.add (acc.value_parameter.name, acc.value_parameter);
@@ -1392,7 +1392,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        return c.type_reference;
                } else if (sym is Property) {
                        var prop = (Property) sym;
-                       var type = prop.type_reference.copy ();
+                       var type = prop.property_type.copy ();
                        type.takes_ownership = false;
                        return type;
                } else if (sym is FormalParameter) {
@@ -2463,7 +2463,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        member_type = f.field_type;
                } else if (init.symbol_reference is Property) {
                        var prop = (Property) init.symbol_reference;
-                       member_type = prop.type_reference;
+                       member_type = prop.property_type;
                        if (prop.set_accessor == null || !prop.set_accessor.writable) {
                                init.error = true;
                                Report.error (init.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));