[vala/staging: 5/6] codegen: Nullable Enums are not allowed as real GLib.Object property



commit bb6ff0d6e1d169ffe65d1ae0b86b76684d250da0
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Jul 14 16:19:47 2017 +0200

    codegen: Nullable Enums are not allowed as real GLib.Object property
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784927

 codegen/valagobjectmodule.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index 33bb878..53afb28 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -728,6 +728,11 @@ public class Vala.GObjectModule : GTypeModule {
                        return false;
                }
 
+               var en = prop.property_type.data_type as Enum;
+               if (en != null && (!get_ccode_has_type_id (en) || prop.property_type.nullable)) {
+                       return false;
+               }
+
                if (prop.property_type is ArrayType && ((ArrayType)prop.property_type).element_type.data_type 
!= string_type.data_type) {
                        return false;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]