From b5ced0d82ac038af7d9438f24e8f851dfacd6543 Mon Sep 17 00:00:00 2001 From: Juerg Billeter Date: Mon, 4 Feb 2008 23:52:32 +0000 Subject: [PATCH] fix error message for invalid symbols, fixes bug 514329 2008-02-05 Juerg Billeter * vala/valasemanticanalyzer.vala: fix error message for invalid symbols, fixes bug 514329 svn path=/trunk/; revision=968 --- ChangeLog | 5 +++++ vala/valasemanticanalyzer.vala | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5ba7aa0..688b4fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-02-05 Jürg Billeter + * vala/valasemanticanalyzer.vala: fix error message for invalid + symbols, fixes bug 514329 + +2008-02-05 Jürg Billeter + * vala/valaclass.vala: improve error reporting for properties, fixes bug 514326 diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index 0df6db6..589fd36 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -1461,7 +1461,15 @@ public class Vala.SemanticAnalyzer : CodeVisitor { if (expr.symbol_reference == null) { expr.error = true; - Report.error (expr.source_reference, "The name `%s' does not exist in the context of `%s'".printf (expr.member_name, base_symbol.get_full_name ())); + + string base_type_name = "(null)"; + if (expr.inner != null && expr.inner.static_type != null) { + base_type_name = expr.inner.static_type.to_string (); + } else if (base_symbol != null) { + base_type_name = base_symbol.get_full_name (); + } + + Report.error (expr.source_reference, "The name `%s' does not exist in the context of `%s'".printf (expr.member_name, base_type_name)); return; } } -- 2.7.4