summaryrefslogtreecommitdiff
path: root/vala/valamethodcall.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-02-20 15:24:36 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2020-02-20 15:24:36 +0100
commit1f51967fa5290bce6cd05ae0306bb98c46b59543 (patch)
tree5ec10b83556f258967ab9be0ceb7571f2e65cda6 /vala/valamethodcall.vala
parent169b99003aa8050de9dd69c47dff57b43b82ec1e (diff)
downloadvala-1f51967fa5290bce6cd05ae0306bb98c46b59543.tar.gz
vala: Properly set CodeNode.error when reporting an error (2)
Diffstat (limited to 'vala/valamethodcall.vala')
-rw-r--r--vala/valamethodcall.vala2
1 files changed, 2 insertions, 0 deletions
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala
index 4a15a6cb4..98a7a878e 100644
--- a/vala/valamethodcall.vala
+++ b/vala/valamethodcall.vala
@@ -466,6 +466,7 @@ public class Vala.MethodCall : Expression {
if (format_literal != null) {
string format = format_literal.eval ();
if (!context.analyzer.check_print_format (format, arg_it, source_reference)) {
+ error = true;
return false;
}
}
@@ -655,6 +656,7 @@ public class Vala.MethodCall : Expression {
// simple statements, no side effects after method call
} else if (!(context.analyzer.current_symbol is Block)) {
// can't handle errors in field initializers
+ error = true;
Report.error (source_reference, "Field initializers must not throw errors");
} else {
// store parent_node as we need to replace the expression in the old parent node later on