[vala/0.50] vala: Set proper source_reference for implicit "this" and "result" variables



commit 077157d9628f83d0b668cd426fd9fede973ed477
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Feb 27 10:34:54 2021 +0100

    vala: Set proper source_reference for implicit "this" and "result" variables

 vala/valaclass.vala            | 10 +++++-----
 vala/valaenum.vala             |  4 ++--
 vala/valaerrordomain.vala      |  2 +-
 vala/valainterface.vala        |  6 +++---
 vala/valamemberaccess.vala     |  2 +-
 vala/valanamespace.vala        |  2 +-
 vala/valaobjecttypesymbol.vala |  4 ++--
 vala/valastruct.vala           |  6 +++---
 8 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index 194e3a8e5..86082795f 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -274,14 +274,14 @@ public class Vala.Class : ObjectTypeSymbol {
                        if (m.this_parameter != null) {
                                m.scope.remove (m.this_parameter.name);
                        }
-                       m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (m, this));
+                       m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (m, this), 
m.source_reference);
                        m.scope.add (m.this_parameter.name, m.this_parameter);
                }
                if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
                        if (m.result_var != null) {
                                m.scope.remove (m.result_var.name);
                        }
-                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
source_reference);
+                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
m.source_reference);
                        m.result_var.is_result = true;
                }
                if (m is CreationMethod) {
@@ -325,7 +325,7 @@ public class Vala.Class : ObjectTypeSymbol {
                base.add_property (prop);
 
                if (prop.binding != MemberBinding.STATIC) {
-                       prop.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (prop, 
this));
+                       prop.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (prop, 
this), prop.source_reference);
                        prop.scope.add (prop.this_parameter.name, prop.this_parameter);
                }
 
@@ -362,7 +362,7 @@ public class Vala.Class : ObjectTypeSymbol {
                        if (c.this_parameter != null) {
                                c.scope.remove (c.this_parameter.name);
                        }
-                       c.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (c, this));
+                       c.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (c, this), 
c.source_reference);
                        c.scope.add (c.this_parameter.name, c.this_parameter);
                }
        }
@@ -395,7 +395,7 @@ public class Vala.Class : ObjectTypeSymbol {
                        if (d.this_parameter != null) {
                                d.scope.remove (d.this_parameter.name);
                        }
-                       d.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (d, this));
+                       d.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (d, this), 
d.source_reference);
                        d.scope.add (d.this_parameter.name, d.this_parameter);
                }
        }
diff --git a/vala/valaenum.vala b/vala/valaenum.vala
index 592e6e7a8..34a95247a 100644
--- a/vala/valaenum.vala
+++ b/vala/valaenum.vala
@@ -80,11 +80,11 @@ public class Vala.Enum : TypeSymbol {
                        return;
                }
                if (m.binding == MemberBinding.INSTANCE) {
-                       m.this_parameter = new Parameter ("this", new EnumValueType (this));
+                       m.this_parameter = new Parameter ("this", new EnumValueType (this), 
m.source_reference);
                        m.scope.add (m.this_parameter.name, m.this_parameter);
                }
                if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
-                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
source_reference);
+                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
m.source_reference);
                        m.result_var.is_result = true;
                }
 
diff --git a/vala/valaerrordomain.vala b/vala/valaerrordomain.vala
index 311f29975..03eb74900 100644
--- a/vala/valaerrordomain.vala
+++ b/vala/valaerrordomain.vala
@@ -63,7 +63,7 @@ public class Vala.ErrorDomain : TypeSymbol {
                        return;
                }
                if (m.binding == MemberBinding.INSTANCE) {
-                       m.this_parameter = new Parameter ("this", new ErrorType (this, null));
+                       m.this_parameter = new Parameter ("this", new ErrorType (this, null), 
m.source_reference);
                        m.scope.add (m.this_parameter.name, m.this_parameter);
                }
 
diff --git a/vala/valainterface.vala b/vala/valainterface.vala
index 06b7ee7e7..e4b663dc9 100644
--- a/vala/valainterface.vala
+++ b/vala/valainterface.vala
@@ -74,11 +74,11 @@ public class Vala.Interface : ObjectTypeSymbol {
                        return;
                }
                if (m.binding != MemberBinding.STATIC) {
-                       m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (m, this));
+                       m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (m, this), 
m.source_reference);
                        m.scope.add (m.this_parameter.name, m.this_parameter);
                }
                if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
-                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
source_reference);
+                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
m.source_reference);
                        m.result_var.is_result = true;
                }
 
@@ -101,7 +101,7 @@ public class Vala.Interface : ObjectTypeSymbol {
                base.add_property (prop);
 
                if (prop.binding != MemberBinding.STATIC) {
-                       prop.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (prop, 
this));
+                       prop.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (prop, 
this), prop.source_reference);
                        prop.scope.add (prop.this_parameter.name, prop.this_parameter);
                }
        }
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index 67af32332..909c5e243 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -453,7 +453,7 @@ public class Vala.MemberAccess : Expression {
                                                m.add_error_type (err);
                                                m.access = SymbolAccessibility.PUBLIC;
                                                m.add_parameter (new Parameter.with_ellipsis ());
-                                               m.this_parameter = new Parameter ("this", 
dynamic_object_type.copy ());
+                                               m.this_parameter = new Parameter ("this", 
dynamic_object_type.copy (), m.source_reference);
                                                dynamic_object_type.type_symbol.scope.add (null, m);
                                                symbol_reference = m;
                                        }
diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala
index a0b23b3c0..121ad9f5e 100644
--- a/vala/valanamespace.vala
+++ b/vala/valanamespace.vala
@@ -395,7 +395,7 @@ public class Vala.Namespace : Symbol {
                }
 
                if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
-                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
source_reference);
+                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
m.source_reference);
                        m.result_var.is_result = true;
                }
 
diff --git a/vala/valaobjecttypesymbol.vala b/vala/valaobjecttypesymbol.vala
index c771f8541..97f1f0f2c 100644
--- a/vala/valaobjecttypesymbol.vala
+++ b/vala/valaobjecttypesymbol.vala
@@ -312,14 +312,14 @@ public abstract class Vala.ObjectTypeSymbol : TypeSymbol {
                        if (m.this_parameter != null) {
                                m.scope.remove (m.this_parameter.name);
                        }
-                       m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (m, this));
+                       m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (m, this), 
m.source_reference);
                        m.scope.add (m.this_parameter.name, m.this_parameter);
                }
                if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
                        if (m.result_var != null) {
                                m.scope.remove (m.result_var.name);
                        }
-                       m.result_var = new LocalVariable (m.return_type.copy (), "result");
+                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
m.source_reference);
                        m.result_var.is_result = true;
                }
 
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index e297e48bd..7493d5360 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -234,11 +234,11 @@ public class Vala.Struct : TypeSymbol {
         */
        public override void add_method (Method m) {
                if (m.binding == MemberBinding.INSTANCE || m is CreationMethod) {
-                       m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (m, this));
+                       m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (m, this), 
m.source_reference);
                        m.scope.add (m.this_parameter.name, m.this_parameter);
                }
                if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
-                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
source_reference);
+                       m.result_var = new LocalVariable (m.return_type.copy (), "result", null, 
m.source_reference);
                        m.result_var.is_result = true;
                }
                if (m is CreationMethod) {
@@ -279,7 +279,7 @@ public class Vala.Struct : TypeSymbol {
                scope.add (prop.name, prop);
 
                if (prop.binding == MemberBinding.INSTANCE) {
-                       prop.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (prop, 
this));
+                       prop.this_parameter = new Parameter ("this", SemanticAnalyzer.get_this_type (prop, 
this), prop.source_reference);
                        prop.scope.add (prop.this_parameter.name, prop.this_parameter);
                }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]