]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Fix some source reference when reporting errors after parsing
authorLuca Bruno <lucabru@src.gnome.org>
Sat, 4 Jan 2014 12:01:09 +0000 (13:01 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Sat, 4 Jan 2014 12:05:56 +0000 (13:05 +0100)
vala/valagirparser.vala

index 4f130ce0a3f99c0ab300fac533fa7eb6fa0f3cf9..8a2fb1b21b12f4cb1dd9930202328d986434c03b 100644 (file)
@@ -3343,7 +3343,7 @@ public class Vala.GirParser : CodeVisitor {
 
                if (return_type is ArrayType && node.return_array_length_idx >= 0) {
                        if (node.return_array_length_idx >= parameters.size) {
-                               Report.error (get_current_src (), "invalid array length index");
+                               Report.error (return_type.source_reference, "invalid array length index");
                        } else {
                                parameters[node.return_array_length_idx].keep = false;
                                node.array_length_parameters.add (node.return_array_length_idx);
@@ -3458,7 +3458,7 @@ public class Vala.GirParser : CodeVisitor {
 
                        if (info.array_length_idx != -1) {
                                if ((info.array_length_idx) >= parameters.size) {
-                                       Report.error (get_current_src (), "invalid array_length index");
+                                       Report.error (info.param.source_reference, "invalid array_length index");
                                        continue;
                                }
                                set_array_ccode (info.param, parameters[info.array_length_idx]);
@@ -3466,7 +3466,7 @@ public class Vala.GirParser : CodeVisitor {
 
                        if (info.closure_idx != -1) {
                                if ((info.closure_idx) >= parameters.size) {
-                                       Report.error (get_current_src (), "invalid closure index");
+                                       Report.error (info.param.source_reference, "invalid closure index");
                                        continue;
                                }
                                if ("%g".printf (parameters[info.closure_idx].vala_idx) != "%g".printf (info.vala_idx + 0.1)) {
@@ -3475,7 +3475,7 @@ public class Vala.GirParser : CodeVisitor {
                        }
                        if (info.destroy_idx != -1) {
                                if (info.destroy_idx >= parameters.size) {
-                                       Report.error (get_current_src (), "invalid destroy index");
+                                       Report.error (info.param.source_reference, "invalid destroy index");
                                        continue;
                                }
                                if ("%g".printf (parameters[info.destroy_idx].vala_idx) != "%g".printf (info.vala_idx + 0.2)) {