]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Set PropertyAccessor.prop property earlier, don't require the semantic
authorJürg Billeter <j@bitron.ch>
Fri, 31 Oct 2008 10:27:56 +0000 (10:27 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 31 Oct 2008 10:27:56 +0000 (10:27 +0000)
2008-10-31  Jürg Billeter  <j@bitron.ch>

* vala/valaproperty.vala:
* vala/valasemanticanalyzer.vala:

Set PropertyAccessor.prop property earlier, don't require the
semantic analyzer to set it

svn path=/trunk/; revision=1945

ChangeLog
vala/valaproperty.vala
vala/valasemanticanalyzer.vala

index 8efc14f904a226bf4a2778e4da12f3495d9a3228..d6ffde62ffefaf0db1542c98f128e5be220e866d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-31  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valaproperty.vala:
+       * vala/valasemanticanalyzer.vala:
+
+       Set PropertyAccessor.prop property earlier, don't require the
+       semantic analyzer to set it
+
 2008-10-31  Jürg Billeter  <j@bitron.ch>
 
        * vala/valacodenode.vala:
index fee4bd3ddc074e8d08ad337f82c8f1b4a5a7102f..c77c7e2e7fc034dfc88cfce918e9a91170c847a4 100644 (file)
@@ -41,12 +41,28 @@ public class Vala.Property : Member, Lockable {
        /**
         * The get accessor of this property if available.
         */
-       public PropertyAccessor? get_accessor { get; set; }
+       public PropertyAccessor? get_accessor {
+               get { return _get_accessor; }
+               set {
+                       _get_accessor = value;
+                       if (value != null) {
+                               value.prop = this;
+                       }
+               }
+       }
        
        /**
         * The set/construct accessor of this property if available.
         */
-       public PropertyAccessor? set_accessor { get; set; }
+       public PropertyAccessor? set_accessor {
+               get { return _set_accessor; }
+               set {
+                       _set_accessor = value;
+                       if (value != null) {
+                               value.prop = this;
+                       }
+               }
+       }
        
        /**
         * Represents the generated ´this' parameter in this property.
@@ -164,6 +180,8 @@ public class Vala.Property : Member, Lockable {
        private weak Property _base_property;
        private Property _base_interface_property;
        private bool base_properties_valid;
+       PropertyAccessor? _get_accessor;
+       PropertyAccessor? _set_accessor;
 
        /**
         * Creates a new property.
index b4c35c087034c2b971b477dc1d8186113f6f6b35..c29a524048dccac96a4ea781029ea9d5c5fb2b3d 100644 (file)
@@ -614,7 +614,18 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
        public override void visit_property (Property prop) {
                current_symbol = prop;
 
-               prop.accept_children (this);
+               prop.property_type.accept (this);
+               
+               if (prop.get_accessor != null) {
+                       prop.get_accessor.accept (this);
+               }
+               if (prop.set_accessor != null) {
+                       prop.set_accessor.accept (this);
+               }
+
+               if (prop.default_expression != null) {
+                       prop.default_expression.accept (this);
+               }
 
                // check whether property type is at least as accessible as the property
                if (!is_type_accessible (prop, prop.property_type)) {
@@ -653,8 +664,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
        }
 
        public override void visit_property_accessor (PropertyAccessor acc) {
-               acc.prop = (Property) current_symbol;
-
                if (acc.readable) {
                        current_return_type = acc.prop.property_type;
                } else {