summaryrefslogtreecommitdiff
path: root/vala/valaconstant.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2009-02-12 23:38:42 +0000
committerJürg Billeter <juergbi@src.gnome.org>2009-02-12 23:38:42 +0000
commit678c29d320b7ff5173c048090661ec0095ba6370 (patch)
tree0efa65ae2e57f5c376352d1149fcb876f88d967c /vala/valaconstant.vala
parent84c5de5a1a8212b65222e66da2c736670c01f5b4 (diff)
downloadvala-678c29d320b7ff5173c048090661ec0095ba6370.tar.gz
Warn when hiding members, support `new' keyword to suppress warning, based
2009-02-12 Jürg Billeter <j@bitron.ch> * vala/valaclass.vala: * vala/valaconstant.vala: * vala/valafield.vala: * vala/valamember.vala: * vala/valamethod.vala: * vala/valaproperty.vala: * vala/valastruct.vala: Warn when hiding members, support `new' keyword to suppress warning, based on patch by Andreas Brauchli, fixes bug 567743 * vala/valacodenode.vala: * vala/valacreationmethod.vala: * vala/valaenum.vala: * vala/valaerrordomain.vala: * vala/valanamespace.vala: * ccode/valaccodelinedirective.vala: Avoid hidden members svn path=/trunk/; revision=2437
Diffstat (limited to 'vala/valaconstant.vala')
-rw-r--r--vala/valaconstant.vala4
1 files changed, 4 insertions, 0 deletions
diff --git a/vala/valaconstant.vala b/vala/valaconstant.vala
index d8fc272df..dd5c4a8dc 100644
--- a/vala/valaconstant.vala
+++ b/vala/valaconstant.vala
@@ -181,6 +181,10 @@ public class Vala.Constant : Member, Lockable {
}
}
+ if (!external_package && !hides && get_hidden_member () != null) {
+ Report.warning (source_reference, "%s hides inherited constant `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+ }
+
analyzer.current_source_file = old_source_file;
analyzer.current_symbol = old_symbol;