From: Jürg Billeter Date: Mon, 6 Aug 2012 12:34:56 +0000 (+0200) Subject: Do not access static members with instance references X-Git-Tag: 0.17.4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01d20d5e6eb94f8635bd067830021c38c5f054a1;p=thirdparty%2Fvala.git Do not access static members with instance references --- diff --git a/vala/valaclass.vala b/vala/valaclass.vala index 678c643a9..63278788a 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -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 ())); diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala index f851d68e5..f8d581afa 100644 --- a/vala/valamemberaccess.vala +++ b/vala/valamemberaccess.vala @@ -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); } } diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala index 08b17bb23..4a70f5730 100644 --- a/vala/valaproperty.vala +++ b/vala/valaproperty.vala @@ -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