]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not access static members with instance references
authorJürg Billeter <j@bitron.ch>
Mon, 6 Aug 2012 12:34:56 +0000 (14:34 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 6 Aug 2012 12:36:22 +0000 (14:36 +0200)
vala/valaclass.vala
vala/valamemberaccess.vala
vala/valaproperty.vala

index 678c643a9980ca8bd399c9737f5305ba8b684a4b..63278788a72bf1de11311ed5098f62709feb3560 100644 (file)
@@ -1,6 +1,6 @@
 /* valaclass.vala
  *
- * Copyright (C) 2006-2010  Jürg Billeter
+ * Copyright (C) 2006-2012  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -829,7 +829,7 @@ public class Vala.Class : ObjectTypeSymbol {
                                while (base_class != null && base_class.is_abstract) {
                                        foreach (Method base_method in base_class.get_methods ()) {
                                                if (base_method.is_abstract) {
-                                                       var override_method = context.analyzer.symbol_lookup_inherited (this, base_method.name) as Method;
+                                                       var override_method = SemanticAnalyzer.symbol_lookup_inherited (this, base_method.name) as Method;
                                                        if (override_method == null || !override_method.overrides) {
                                                                error = true;
                                                                Report.error (source_reference, "`%s' does not implement abstract method `%s'".printf (get_full_name (), base_method.get_full_name ()));
@@ -838,7 +838,7 @@ public class Vala.Class : ObjectTypeSymbol {
                                        }
                                        foreach (Property base_property in base_class.get_properties ()) {
                                                if (base_property.is_abstract) {
-                                                       var override_property = context.analyzer.symbol_lookup_inherited (this, base_property.name) as Property;
+                                                       var override_property = SemanticAnalyzer.symbol_lookup_inherited (this, base_property.name) as Property;
                                                        if (override_property == null || !override_property.overrides) {
                                                                error = true;
                                                                Report.error (source_reference, "`%s' does not implement abstract property `%s'".printf (get_full_name (), base_property.get_full_name ()));
index f851d68e5cd13cf91734fc5f70e5e680f2804c6d..f8d581afa81c1219b8988993932b5e61f8a2909e 100644 (file)
@@ -265,7 +265,7 @@ public class Vala.MemberAccess : Expression {
                                        }
                                }
 
-                               symbol_reference = context.analyzer.symbol_lookup_inherited (sym, member_name);
+                               symbol_reference = SemanticAnalyzer.symbol_lookup_inherited (sym, member_name);
 
                                if (symbol_reference == null) {
                                        if (sym is TypeSymbol) {
@@ -800,7 +800,7 @@ public class Vala.MemberAccess : Expression {
                                }
 
                                if (instance && base_method.parent_symbol is TypeSymbol) {
-                                       inner.target_type = context.analyzer.get_data_type_for_symbol ((TypeSymbol) base_method.parent_symbol);
+                                       inner.target_type = SemanticAnalyzer.get_data_type_for_symbol ((TypeSymbol) base_method.parent_symbol);
                                        inner.target_type.value_owned = base_method.this_parameter.variable_type.value_owned;
                                }
                        } else if (symbol_reference is Property) {
@@ -816,12 +816,12 @@ public class Vala.MemberAccess : Expression {
                                }
 
                                if (instance && base_property.parent_symbol != null) {
-                                       inner.target_type = context.analyzer.get_data_type_for_symbol ((TypeSymbol) base_property.parent_symbol);
+                                       inner.target_type = SemanticAnalyzer.get_data_type_for_symbol ((TypeSymbol) base_property.parent_symbol);
                                }
                        } else if ((symbol_reference is Field
                                    || symbol_reference is Signal)
                                   && instance && symbol_reference.parent_symbol != null) {
-                               var parent_type = context.analyzer.get_data_type_for_symbol ((TypeSymbol) symbol_reference.parent_symbol);
+                               var parent_type = SemanticAnalyzer.get_data_type_for_symbol ((TypeSymbol) symbol_reference.parent_symbol);
                                inner.target_type = parent_type.get_actual_type (inner.value_type, null, this);
                        }
                }
index 08b17bb230a05bf8d9ef77458e46a63cce02b7bb..4a70f5730fa8a55de03dc6f527609675a888f312 100644 (file)
@@ -1,6 +1,6 @@
 /* valaproperty.vala
  *
- * Copyright (C) 2006-2010  Jürg Billeter
+ * Copyright (C) 2006-2012  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -209,7 +209,7 @@ public class Vala.Property : Symbol, Lockable {
                        return false;
                }
 
-               var object_type = CodeContext.get().analyzer.get_data_type_for_symbol ((TypeSymbol) parent_symbol);
+               var object_type = SemanticAnalyzer.get_data_type_for_symbol ((TypeSymbol) parent_symbol);
 
                if (get_accessor != null) {
                        // check accessor value_type instead of property_type