[vala/wip/ricotz/lsp-rev: 13/15] WIP vala: Improve dealing with errornous nodes
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/ricotz/lsp-rev: 13/15] WIP vala: Improve dealing with errornous nodes
- Date: Thu, 20 Feb 2020 20:14:58 +0000 (UTC)
commit bda6c4129bb617f415e9ed7e44f8b5bcedf3abb4
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Feb 18 12:54:30 2020 +0100
WIP vala: Improve dealing with errornous nodes
vala/valaarraytype.vala | 4 +++-
vala/valabinaryexpression.vala | 2 +-
vala/valalambdaexpression.vala | 4 +++-
vala/valamethodcall.vala | 6 ++++--
4 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala
index bb6dceb44..e41fb7904 100644
--- a/vala/valaarraytype.vala
+++ b/vala/valaarraytype.vala
@@ -91,7 +91,9 @@ public class Vala.ArrayType : ReferenceType {
}
public override Symbol? get_member (string member_name) {
- if (member_name == "length") {
+ if (error) {
+ // don't try anything
+ } else if (member_name == "length") {
return get_length_field ();
} else if (member_name == "move") {
return get_move_method ();
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 60c911677..1022060a8 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -328,7 +328,7 @@ public class Vala.BinaryExpression : Expression {
return false;
}
- if (operator != BinaryOperator.IN && right.value_type == null) {
+ if (right.value_type == null) {
Report.error (right.source_reference, "invalid right operand");
error = true;
return false;
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index 314bfa7ce..5174d0e09 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -233,7 +233,9 @@ public class Vala.LambdaExpression : Expression {
/* lambda expressions should be usable like MemberAccess of a method */
symbol_reference = method;
- method.check (context);
+ if (!method.check (context)) {
+ error = true;
+ }
value_type = new MethodType (method);
value_type.value_owned = target_type.value_owned;
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala
index 98a7a878e..03063abb8 100644
--- a/vala/valamethodcall.vala
+++ b/vala/valamethodcall.vala
@@ -155,8 +155,10 @@ public class Vala.MethodCall : Expression {
} else if (mtype is ObjectType) {
// constructor
unowned Class cl = (Class) ((ObjectType) mtype).type_symbol;
- unowned Method m = cl.default_construction_method;
- m.get_error_types (collection, source_reference);
+ unowned Method? m = cl.default_construction_method;
+ if (m != null) {
+ m.get_error_types (collection, source_reference);
+ }
} else if (mtype is DelegateType) {
unowned Delegate d = ((DelegateType) mtype).delegate_symbol;
d.get_error_types (collection, source_reference);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]