]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Move construct property checks to SemanticAnalyzer pass 6c8c75f59024b32230b1c13ea344a568f19b86df
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 28 Apr 2019 07:22:13 +0000 (09:22 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 28 Apr 2019 07:27:06 +0000 (09:27 +0200)
codegen/valaccodebasemodule.vala
vala/valapropertyaccessor.vala

index f0d03ba781f655c6c96cdf67b6c115627c39d1d4..9a134f33f8264e24596020e6c61d49f9bec69764 100644 (file)
@@ -1640,16 +1640,6 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                var t = (TypeSymbol) prop.parent_symbol;
 
-               if (acc.construction && !t.is_subtype_of (gobject_type)) {
-                       Report.error (acc.source_reference, "construct properties require GLib.Object");
-                       acc.error = true;
-                       return;
-               } else if (acc.construction && !context.analyzer.is_gobject_property (prop)) {
-                       Report.error (acc.source_reference, "construct properties not supported for specified property type");
-                       acc.error = true;
-                       return;
-               }
-
                // do not declare overriding properties and interface implementations
                if (prop.is_abstract || prop.is_virtual
                    || (prop.base_property == null && prop.base_interface_property == null)) {
index e348c2510f555354af31d4b56580dec96b43d627..f9fc981713e3244d8499ce05aa73c4746c43c27f 100644 (file)
@@ -184,6 +184,16 @@ public class Vala.PropertyAccessor : Subroutine {
                        return false;
                }
 
+               if (construction && !((TypeSymbol) prop.parent_symbol).is_subtype_of (context.analyzer.object_type)) {
+                       error = true;
+                       Report.error (source_reference, "construct properties require `GLib.Object'");
+                       return false;
+               } else if (construction && !context.analyzer.is_gobject_property (prop)) {
+                       error = true;
+                       Report.error (source_reference, "construct properties not supported for specified property type");
+                       return false;
+               }
+
                if (body != null && prop.is_abstract) {
                        error = true;
                        Report.error (source_reference, "Accessor of abstract property `%s' cannot have body".printf (prop.get_full_name ()));