]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error when field type is less accessible than field
authorJürg Billeter <j@bitron.ch>
Fri, 9 Jan 2009 23:07:48 +0000 (23:07 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 9 Jan 2009 23:07:48 +0000 (23:07 +0000)
2009-01-10  Jürg Billeter  <j@bitron.ch>

* vala/valafield.vala:

Report error when field type is less accessible than field

svn path=/trunk/; revision=2315

ChangeLog
vala/valafield.vala

index dfe6bdcc33b56df98fc5760836046e48032d1248..892604af0876f408b915dff2f1095be9a233dc4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-10  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valafield.vala:
+
+       Report error when field type is less accessible than field
+
 2009-01-09  Jürg Billeter  <j@bitron.ch>
 
        * vala/valasemanticanalyzer.vala:
index d678e6b2a2bded536d8705cdd86304238d18297b..d8f7f80c8d9678b541d1d57886cbb1bd434fb22e 100644 (file)
@@ -257,6 +257,13 @@ public class Vala.Field : Member, Lockable {
 
                field_type.check (analyzer);
 
+               // check whether field type is at least as accessible as the field
+               if (!analyzer.is_type_accessible (this, field_type)) {
+                       error = true;
+                       Report.error (source_reference, "field type `%s` is less accessible than field `%s`".printf (field_type.to_string (), get_full_name ()));
+                       return false;
+               }
+
                process_attributes ();
 
                if (initializer != null) {