[vala/wip/ricotz/lsp-rev: 9/9] WIP vala: Unresolved namespaces?
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/ricotz/lsp-rev: 9/9] WIP vala: Unresolved namespaces?
- Date: Wed, 19 Feb 2020 15:02:59 +0000 (UTC)
commit 3267defe32cf9c23ba91a09d0d884f761062bf58
Author: Princeton Ferro <princetonferro gmail com>
Date: Tue Feb 18 12:20:00 2020 +0100
WIP vala: Unresolved namespaces?
vala/valagirparser.vala | 6 ++++++
vala/valamemberaccess.vala | 3 +++
2 files changed, 9 insertions(+)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 6d6f767d8..ae8692fbb 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1385,6 +1385,12 @@ public class Vala.GirParser : CodeVisitor {
continue;
}
+ if (ns == null) {
+ // We should not have a null namespace unless we're in LSP mode.
+ assert (context.keep_going);
+ continue;
+ }
+
provided_namespaces.add ("%s-%s".printf (gir_namespace, gir_version));
var gir_symbol = new UnresolvedSymbol (null, gir_namespace);
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index 946bd2b0a..3866f6051 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -307,6 +307,9 @@ public class Vala.MemberAccess : Expression {
if (symbol_reference == null && source_reference != null) {
foreach (UsingDirective ns in source_reference.using_directives) {
+ if (!(ns.namespace_symbol is Vala.Namespace)) {
+ continue;
+ }
var local_sym = ns.namespace_symbol.scope.lookup (member_name);
if (local_sym != null) {
if (symbol_reference != null && symbol_reference !=
local_sym) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]