From: Rico Tzschichholz Date: Mon, 15 Apr 2024 06:38:39 +0000 (+0200) Subject: vala: Point to the invalid initializer on error X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=689d13eff8d841481f3f94737d9744dc910d0ee8;p=thirdparty%2Fvala.git vala: Point to the invalid initializer on error --- diff --git a/vala/valafield.vala b/vala/valafield.vala index 2f675a96f..0204d24d8 100644 --- a/vala/valafield.vala +++ b/vala/valafield.vala @@ -158,7 +158,7 @@ public class Vala.Field : Variable, Lockable { if (initializer.value_type == null) { error = true; - Report.error (source_reference, "expression type not allowed as initializer"); + Report.error (initializer.source_reference, "expression type not allowed as initializer"); return false; } diff --git a/vala/valalocalvariable.vala b/vala/valalocalvariable.vala index cbe612254..099152c20 100644 --- a/vala/valalocalvariable.vala +++ b/vala/valalocalvariable.vala @@ -196,7 +196,7 @@ public class Vala.LocalVariable : Variable { if (initializer.value_type is MethodType) { if (!(initializer is MemberAccess) && !(initializer is LambdaExpression)) { error = true; - Report.error (source_reference, "expression type not allowed as initializer"); + Report.error (initializer.source_reference, "expression type not allowed as initializer"); return false; } @@ -211,12 +211,12 @@ public class Vala.LocalVariable : Variable { } } else { error = true; - Report.error (source_reference, "expression type not allowed as initializer"); + Report.error (initializer.source_reference, "expression type not allowed as initializer"); return false; } } else if (initializer.value_type == null) { error = true; - Report.error (source_reference, "expression type not allowed as initializer"); + Report.error (initializer.source_reference, "expression type not allowed as initializer"); return false; }