check accessiblity of property types, fixes bug 512404
authorJuerg Billeter <j@bitron.ch>
Mon, 7 Apr 2008 14:08:31 +0000 (14:08 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 7 Apr 2008 14:08:31 +0000 (14:08 +0000)
2008-04-07  Juerg Billeter  <j@bitron.ch>

* vala/valasemanticanalyzer.vala: check accessiblity of property
  types, fixes bug 512404

svn path=/trunk/; revision=1171

ChangeLog
vala/valasemanticanalyzer.vala

index df042ef..1acf173 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-04-07  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valasemanticanalyzer.vala: check accessiblity of property
+         types, fixes bug 512404
+
+2008-04-07  Jürg Billeter  <j@bitron.ch>
+
        * gobject/valaccodeassignmentbinding.vala: fix element access
          assignment with pointers, fixes bug 519933
 
index c27eeb5..882a7af 100644 (file)
@@ -621,6 +621,13 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 
                prop.accept_children (this);
 
+               // check whether property type is at least as accessible as the property
+               if (!is_type_accessible (prop, prop.type_reference)) {
+                       prop.error = true;
+                       Report.error (prop.source_reference, "property type `%s` is less accessible than property `%s`".printf (prop.type_reference.to_string (), prop.get_full_name ()));
+                       return;
+               }
+
                /* abstract/virtual properties using reference types without
                 * reference counting need to transfer ownership of their
                 * return values because of limitations in the GObject property