]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Output additional information when accessing unknown member
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 31 Jul 2023 17:27:50 +0000 (19:27 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 31 Jul 2023 17:27:50 +0000 (19:27 +0200)
Return location of the variable declaration which will usually
show its type.

vala/valamemberaccess.vala

index 31b1ca9590f78c1a5fe276dd8f8cce5d47d55183..08b5b384e90f6354907dbc5f215ab15239b56a69 100644 (file)
@@ -615,6 +615,9 @@ public class Vala.MemberAccess : Expression {
                        }
 
                        Report.error (source_reference, "The name `%s' does not exist in the context of `%s'%s%s", member_name, base_type_name, base_type_package, visited_types_string);
+                       if (inner != null && inner.symbol_reference != null && inner.symbol_reference.source_reference != null) {
+                               Report.notice (inner.symbol_reference.source_reference, "`%s' was declared here", inner.symbol_reference.name);
+                       }
                        value_type = new InvalidType ();
                        return false;
                } else if (symbol_reference.error) {