From: Jürg Billeter Date: Fri, 31 Oct 2008 10:27:56 +0000 (+0000) Subject: Set PropertyAccessor.prop property earlier, don't require the semantic X-Git-Tag: VALA_0_5_1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45cf888585d45d712ae22897cbe3d59ce67de2ba;p=thirdparty%2Fvala.git Set PropertyAccessor.prop property earlier, don't require the semantic 2008-10-31 Jürg Billeter * 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 --- diff --git a/ChangeLog b/ChangeLog index 8efc14f90..d6ffde62f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-10-31 Jürg Billeter + + * 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 * vala/valacodenode.vala: diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala index fee4bd3dd..c77c7e2e7 100644 --- a/vala/valaproperty.vala +++ b/vala/valaproperty.vala @@ -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. diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index b4c35c087..c29a52404 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -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 {