From: Jürg Billeter Date: Fri, 9 Jan 2009 23:07:48 +0000 (+0000) Subject: Report error when field type is less accessible than field X-Git-Tag: VALA_0_5_5~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=458713d55ba5261bc0dc3f544413fde5f8407458;p=thirdparty%2Fvala.git Report error when field type is less accessible than field 2009-01-10 Jürg Billeter * vala/valafield.vala: Report error when field type is less accessible than field svn path=/trunk/; revision=2315 --- diff --git a/ChangeLog b/ChangeLog index dfe6bdcc3..892604af0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-10 Jürg Billeter + + * vala/valafield.vala: + + Report error when field type is less accessible than field + 2009-01-09 Jürg Billeter * vala/valasemanticanalyzer.vala: diff --git a/vala/valafield.vala b/vala/valafield.vala index d678e6b2a..d8f7f80c8 100644 --- a/vala/valafield.vala +++ b/vala/valafield.vala @@ -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) {