[vala/wip/issue/327: 9/27] Fix unassigned error and static access warning
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/issue/327: 9/27] Fix unassigned error and static access warning
- Date: Mon, 27 Apr 2020 12:14:46 +0000 (UTC)
commit f803328617106cdb292eeb101c2c404665e69731
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Mar 28 10:32:20 2020 +0100
Fix unassigned error and static access warning
vala/valaflowanalyzer.vala | 12 ++++++++++++
vala/valamemberaccess.vala | 6 ++++--
2 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala
index 6f58dd3a0..907c219ea 100644
--- a/vala/valaflowanalyzer.vala
+++ b/vala/valaflowanalyzer.vala
@@ -599,6 +599,18 @@ public class Vala.FlowAnalyzer : CodeVisitor {
}
}
+ public override void visit_with_statement (WithStatement stmt) {
+ if (unreachable (stmt)) {
+ return;
+ }
+
+ current_block.add_node (stmt.expression);
+
+ handle_errors (stmt.expression);
+
+ stmt.body.accept_children (this);
+ }
+
public override void visit_if_statement (IfStatement stmt) {
if (unreachable (stmt)) {
return;
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index e95a3a9a4..3b114176d 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -304,8 +304,10 @@ public class Vala.MemberAccess : Expression {
if (symbol_reference == null && sym is WithStatement) {
unowned WithStatement w = (WithStatement) sym;
- inner = w.expression;
- symbol_reference = inner.value_type.get_member (member_name);
+ symbol_reference = w.expression.value_type.get_member (member_name);
+ if (symbol_reference != null) {
+ inner = w.expression;
+ }
may_access_instance_members = true;
may_access_klass_members = true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]