[vala] Do not access static members with instance references
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Do not access static members with instance references
- Date: Mon, 6 Aug 2012 12:38:14 +0000 (UTC)
commit 01d20d5e6eb94f8635bd067830021c38c5f054a1
Author: JÃrg Billeter <j bitron ch>
Date: Mon Aug 6 14:34:56 2012 +0200
Do not access static members with instance references
vala/valaclass.vala | 6 +++---
vala/valamemberaccess.vala | 8 ++++----
vala/valaproperty.vala | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index 678c643..6327878 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 f851d68..f8d581a 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 08b17bb..4a70f57 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]