]> 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>
Wed, 2 Aug 2023 12:59:17 +0000 (14:59 +0200)
Return location of the variable declaration which will usually
show its type.

vala/valamemberaccess.vala

index 2b75adcc5545011eaf6a6ff3c085497658fed91b..810205a4570b47396c92c32828baaf5bdbfd0e47 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) {