]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Revert "Set parent_node and always copy datatype when assigned to code nodes."
authorLuca Bruno <lucabru@src.gnome.org>
Mon, 7 Oct 2013 18:50:47 +0000 (20:50 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 7 Oct 2013 18:51:03 +0000 (20:51 +0200)
This reverts commit a09c9e93af0d64b9331c274de573465fe070b722.

Fixes bug 709587.

21 files changed:
vala/valaarraycreationexpression.vala
vala/valaarraytype.vala
vala/valacastexpression.vala
vala/valacatchclause.vala
vala/valaclass.vala
vala/valaconstant.vala
vala/valadatatype.vala
vala/valadelegate.vala
vala/valaexpression.vala
vala/valaforeachstatement.vala
vala/valainterface.vala
vala/valamemberaccess.vala
vala/valamethod.vala
vala/valaobjectcreationexpression.vala
vala/valapointertype.vala
vala/valaproperty.vala
vala/valapropertyaccessor.vala
vala/valasignal.vala
vala/valasizeofexpression.vala
vala/valatypeofexpression.vala
vala/valavariable.vala

index c0f38300f9189f308d14af8d3965541bd469bb59..3b52748ff9e9cea6fb42674860ca8a87e0c548a6 100644 (file)
@@ -34,7 +34,7 @@ public class Vala.ArrayCreationExpression : Expression {
        public DataType element_type {
                get { return _element_type; }
                set {
-                       _element_type = value.copy ();
+                       _element_type = value;
                        _element_type.parent_node = this;
                }
        }
index 11bf1a720e3d8f6a68d7275e06b6b45b26703f17..b3767233529d19bbf4f17f66af8fb47628a69e7e 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.ArrayType : ReferenceType {
        public DataType element_type {
                get { return _element_type; }
                set {
-                       _element_type = value.copy ();
+                       _element_type = value;
                        _element_type.parent_node = this;
                }
        }
index c09e8abdcb9ad963ad2f6591b87b7b5f33c816f2..c7a72b6f254e20a7260317c2d1d7522f12093fe5 100644 (file)
@@ -44,7 +44,7 @@ public class Vala.CastExpression : Expression {
        public DataType type_reference {
                get { return _data_type; }
                set {
-                       _data_type = value.copy ();
+                       _data_type = value;
                        _data_type.parent_node = this;
                }
        }
index ef1f99840861491f60e7d972aa5038499c66b4ce..b2f20a49194dbf767c015a9eea72427376327550 100644 (file)
@@ -31,9 +31,8 @@ public class Vala.CatchClause : CodeNode {
        public DataType? error_type {
                get { return _data_type; }
                set {
-                       _data_type = null;
-                       if (value != null) {
-                               _data_type = value.copy ();
+                       _data_type = value;
+                       if (_data_type != null) {
                                _data_type.parent_node = this;
                        }
                }
index a88fb01ee979b29f2b550f24ab307b8023606029..ba23a508fb6611decf042bbfcb031b1353db829b 100644 (file)
@@ -225,11 +225,10 @@ public class Vala.Class : ObjectTypeSymbol {
         * @param type a class or interface reference
         */
        public void add_base_type (DataType type) {
-               var copy = type.copy ();
-               base_types.add (copy);
-               copy.parent_node = this;
+               base_types.add (type);
+               type.parent_node = this;
        }
-       
+
        /**
         * Returns a copy of the base type list.
         *
@@ -557,7 +556,6 @@ public class Vala.Class : ObjectTypeSymbol {
                for (int i = 0; i < base_types.size; i++) {
                        if (base_types[i] == old_type) {
                                base_types[i] = new_type;
-                               new_type.parent_node = this;
                                return;
                        }
                }
index 0c789bd206142facb2b1321285322f479cff422a..53b84c60e0eb91807dac1943915b4216660e7dda 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.Constant : Symbol, Lockable {
        public DataType type_reference {
                get { return _data_type; }
                set {
-                       _data_type = value.copy ();
+                       _data_type = value;
                        _data_type.parent_node = this;
                }
        }
index 376e1f172a595ec4d387f604608097b1860bb86e..085d321e0519302ff1a0da8c50a2a7c130b422e2 100644 (file)
@@ -71,9 +71,8 @@ public abstract class Vala.DataType : CodeNode {
                if (type_argument_list == null) {
                        type_argument_list = new ArrayList<DataType> ();
                }
-               var copy = arg.copy ();
-               type_argument_list.add (copy);
-               copy.parent_node = this;
+               type_argument_list.add (arg);
+               arg.parent_node = this;
        }
        
        /**
@@ -252,7 +251,6 @@ public abstract class Vala.DataType : CodeNode {
                        for (int i = 0; i < type_argument_list.size; i++) {
                                if (type_argument_list[i] == old_type) {
                                        type_argument_list[i] = new_type;
-                                       new_type.parent_node = this;
                                        return;
                                }
                        }
index 14f7ffade41b876728e2d8410c0d028c94f5c6bb..d949c611f18e47992e1c8da31e59ebffa55b2f56 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.Delegate : TypeSymbol {
        public DataType return_type {
                get { return _return_type; }
                set {
-                       _return_type = value.copy ();
+                       _return_type = value;
                        _return_type.parent_node = this;
                }
        }
index 96e037d029a5ea4514dc22283f5445a04c7a9afb..620086e9806d220a32506065cf8402d0c5c2780c 100644 (file)
@@ -31,71 +31,18 @@ public abstract class Vala.Expression : CodeNode {
         * 
         * The semantic analyzer computes this value.
         */
-       public DataType value_type {
-               get {
-                       return _value_type;
-               }
-
-               set {
-                       _value_type = null;
-                       if (value != null) {
-                               _value_type = value.copy ();
-                               _value_type.parent_node = this;
-                       }
-               }
-       }
-
-       private DataType _value_type;
-
-       public DataType? formal_value_type {
-               get {
-                       return _formal_value_type;
-               }
-               set {
-                       _formal_value_type = null;
-                       if (value != null) {
-                               _formal_value_type = value.copy ();
-                               _formal_value_type.parent_node = this;
-                       }
-               }
-       }
+       public DataType value_type { get; set; }
 
-       private DataType _formal_value_type;
+       public DataType? formal_value_type { get; set; }
 
        /*
         * The static type this expression is expected to have.
         *
         * The semantic analyzer computes this value, lambda expressions use it.
         */
-       public DataType target_type {
-               get {
-                       return _target_type;
-               }
-               set {
-                       _target_type = null;
-                       if (value != null) {
-                               _target_type = value.copy ();
-                               _target_type.parent_node = this;
-                       }
-               }
-       }
-
-       private DataType _target_type;
-
-       public DataType? formal_target_type {
-               get {
-                       return _formal_target_type;
-               }
-               set {
-                       _formal_target_type = null;
-                       if (value != null) {
-                               _formal_target_type = value.copy ();
-                               _formal_target_type.parent_node = this;
-                       }
-               }
-       }
+       public DataType target_type { get; set; }
 
-       private DataType _formal_target_type;
+       public DataType? formal_target_type { get; set; }
 
        /**
         * The symbol this expression refers to.
index e10192d8983f7dcecdf135cddd2e7c1b166c3564..8c6522229763a83c4354261ff9b37c14c0096b4c 100644 (file)
@@ -32,9 +32,8 @@ public class Vala.ForeachStatement : Block {
        public DataType? type_reference {
                get { return _data_type; }
                set {
-                       _data_type = null;
-                       if (value != null) {
-                               _data_type = value.copy ();
+                       _data_type = value;
+                       if (_data_type != null) {
                                _data_type.parent_node = this;
                        }
                }
index cc7ce13aa12919a5c1cae99f66d9d8055b7aee89..49bc0ae2cf2d1e79135e916cd8d20c8d7a187aca 100644 (file)
@@ -95,9 +95,8 @@ public class Vala.Interface : ObjectTypeSymbol {
         * @param type an interface or class reference
         */
        public void add_prerequisite (DataType type) {
-               var copy = type.copy ();
-               prerequisites.add (copy);
-               copy.parent_node = this;
+               prerequisites.add (type);
+               type.parent_node = this;
        }
 
        /**
@@ -107,9 +106,7 @@ public class Vala.Interface : ObjectTypeSymbol {
         * @param type an interface or class reference
         */
        public void prepend_prerequisite (DataType type) {
-               var copy = type.copy ();
-               prerequisites.insert (0, copy);
-               copy.parent_node = this;
+               prerequisites.insert (0, type);
        }
 
        /**
@@ -352,7 +349,6 @@ public class Vala.Interface : ObjectTypeSymbol {
                for (int i = 0; i < prerequisites.size; i++) {
                        if (prerequisites[i] == old_type) {
                                prerequisites[i] = new_type;
-                               new_type.parent_node = this;
                                return;
                        }
                }
index 156f9aa91b9c1ed953f2af1b37b5e784003c28f6..af9f51f383c171500f3b9985ecb49320e6853409 100644 (file)
@@ -102,9 +102,8 @@ public class Vala.MemberAccess : Expression {
         * @param arg a type reference
         */
        public void add_type_argument (DataType arg) {
-               var copy = arg.copy ();
-               type_argument_list.add (copy);
-               copy.parent_node = this;
+               type_argument_list.add (arg);
+               arg.parent_node = this;
        }
        
        /**
@@ -161,7 +160,6 @@ public class Vala.MemberAccess : Expression {
                for (int i = 0; i < type_argument_list.size; i++) {
                        if (type_argument_list[i] == old_type) {
                                type_argument_list[i] = new_type;
-                               new_type.parent_node = this;
                                return;
                        }
                }
index eef04ab72d247c567dcf483c9c0f6d988ca7c73d..663ae6fdfcdf4e1eba57130ac2d9aa493a86029c 100644 (file)
@@ -36,7 +36,7 @@ public class Vala.Method : Subroutine {
        public DataType return_type {
                get { return _return_type; }
                set {
-                       _return_type = value.copy ();
+                       _return_type = value;
                        _return_type.parent_node = this;
                }
        }
index 56fb3ae3458e57daf24e77f257129721b75025bf..a4121f3aae3abc9b7e9cfd44405825038bdb45fa 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.ObjectCreationExpression : Expression {
        public DataType type_reference {
                get { return _data_type; }
                set {
-                       _data_type = value.copy ();
+                       _data_type = value;
                        _data_type.parent_node = this;
                }
        }
index 5ec9228c53886c4b61c6879d4927709907ce77f9..4bfaf34ee862dad864250c10ec4843a74461c659 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.PointerType : DataType {
        public DataType base_type {
                get { return _base_type; }
                set {
-                       _base_type = value.copy ();
+                       _base_type = value;
                        _base_type.parent_node = this;
                }
        }
index 300fb4dd16ea0f2cf53e92647c835e004d52dc87..8a8ced49b432f2dcec63741441281b0badc4ebd7 100644 (file)
@@ -33,9 +33,8 @@ public class Vala.Property : Symbol, Lockable {
        public DataType? property_type {
                get { return _data_type; }
                set {
-                       _data_type = null;
+                       _data_type = value;
                        if (value != null) {
-                               _data_type = value.copy ();
                                _data_type.parent_node = this;
                        }
                }
index 3903ae83519f0fd07124325ce3c69c66d44226ba..466fe6c181bd6c87b4a0f6cc920160ba0a98c0d0 100644 (file)
@@ -39,9 +39,8 @@ public class Vala.PropertyAccessor : Subroutine {
        public DataType? value_type {
                get { return _value_type; }
                set {
-                       _value_type = null;
+                       _value_type = value;
                        if (value != null) {
-                               _value_type = value.copy ();
                                _value_type.parent_node = this;
                        }
                }
index 866760fe2d0cd4dea89d9f6608adf46737a7c176..3ddc453b38e6956b1454b70fe3b265cf2611c3fd 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.Signal : Symbol, Lockable {
        public DataType return_type {
                get { return _return_type; }
                set {
-                       _return_type = value.copy ();
+                       _return_type = value;
                        _return_type.parent_node = this;
                }
        }
index 1fd80c456cd0f6afe707cf4dfc79d53065e562b6..42c1ee5991bbc130e26addc3da157fdb56d2eb82 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.SizeofExpression : Expression {
        public DataType type_reference {
                get { return _data_type; }
                set {
-                       _data_type = value.copy ();
+                       _data_type = value;
                        _data_type.parent_node = this;
                }
        }
index 1e932f16f113d583e2aee98f8fd956efcb08508e..9b0e02e13f1ce240fcb57190e57651d7e4c82ced 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.TypeofExpression : Expression {
        public DataType type_reference {
                get { return _data_type; }
                set {
-                       _data_type = value.copy ();
+                       _data_type = value;
                        _data_type.parent_node = this;
                }
        }
index a65fcbeb290986394a67a170decb68abcd2d85f9..e625e660bba7890c52d314addadb74f68f9d0bfa 100644 (file)
@@ -42,9 +42,8 @@ public class Vala.Variable : Symbol {
        public DataType? variable_type {
                get { return _variable_type; }
                set {
-                       _variable_type = null;
-                       if (value != null) {
-                               _variable_type = value.copy ();
+                       _variable_type = value;
+                       if (_variable_type != null) {
                                _variable_type.parent_node = this;
                        }
                }