]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: allow "type" property if it's NoAccessorMethod
authorLuca Bruno <lucabru@src.gnome.org>
Wed, 24 Dec 2014 00:25:09 +0000 (01:25 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Wed, 24 Dec 2014 18:02:21 +0000 (19:02 +0100)
Fixes bug 741862

codegen/valagtypemodule.vala

index b25cec4c538a82943cbafdef5ec95d53ad127bea..f4d3ea2f8e3668caa873235ebc688caccfe8a5d0 100644 (file)
@@ -2204,7 +2204,16 @@ public class Vala.GTypeModule : GErrorModule {
        public override void visit_property (Property prop) {
                var cl = current_type_symbol as Class;
                var st = current_type_symbol as Struct;
-               if (prop.name == "type" && ((cl != null && !cl.is_compact) || (st != null && get_ccode_has_type_id (st)))) {
+
+               var base_prop = prop;
+               if (prop.base_property != null) {
+                       base_prop = prop.base_property;
+               } else if (prop.base_interface_property != null) {
+                       base_prop = prop.base_interface_property;
+               }
+
+               if (base_prop.get_attribute ("NoAccessorMethod") == null &&
+                       prop.name == "type" && ((cl != null && !cl.is_compact) || (st != null && get_ccode_has_type_id (st)))) {
                        Report.error (prop.source_reference, "Property 'type' not allowed");
                        return;
                }