From 97ea932ba53a03980523fbad09efa2f7dc9f21be Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Mon, 22 Mar 2010 20:10:16 +0100 Subject: [PATCH] Fix error message on duplicate definition in root namespace Fixes bug 601349. --- vala/valascope.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vala/valascope.vala b/vala/valascope.vala index 046546123..afab10aa4 100644 --- a/vala/valascope.vala +++ b/vala/valascope.vala @@ -1,6 +1,6 @@ /* valascope.vala * - * Copyright (C) 2006-2008 Jürg Billeter + * Copyright (C) 2006-2010 Jürg Billeter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -61,7 +61,11 @@ public class Vala.Scope { symbol_table = new HashMap (str_hash, str_equal); } else if (lookup (name) != null) { owner.error = true; - Report.error (sym.source_reference, "`%s' already contains a definition for `%s'".printf (owner.get_full_name (), name)); + if (owner.name == null && owner.parent_symbol == null) { + Report.error (sym.source_reference, "The root namespace already contains a definition for `%s'".printf (name)); + } else { + Report.error (sym.source_reference, "`%s' already contains a definition for `%s'".printf (owner.get_full_name (), name)); + } return; } -- 2.47.3