]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Don't emit g_type_add_instance_private() in *_register_type() cb669029dbd56e1d60586b39161f4948250c2f56
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 13 Jul 2018 17:14:55 +0000 (19:14 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 13 Jul 2018 17:16:17 +0000 (19:16 +0200)
This fixes warnings like "sys:1: Warning: cannot add private field to
invalid (non-instantiatable) type ..."

Regression of df56f916e52e5efe3876afed59a6190f6cead1c8

codegen/valatyperegisterfunction.vala

index c1811d9498560d93642c31b72cbd4560f58b4155..750537500f65127337330c8742d675c31bbc1451 100644 (file)
@@ -213,7 +213,7 @@ public abstract class Vala.TypeRegisterFunction {
                        type_init.add_statement (new CCodeExpressionStatement (add_class_private_call));
                }
 
-               if (cl != null && (cl.has_private_fields || cl.get_type_parameters ().size > 0)) {
+               if (!plugin && cl != null && (cl.has_private_fields || cl.get_type_parameters ().size > 0)) {
                        var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_type_add_instance_private"));
                        ccall.add_argument (new CCodeIdentifier (type_id_name));
                        ccall.add_argument (new CCodeIdentifier ("sizeof (%sPrivate)".printf (get_ccode_name (cl))));