From: Rico Tzschichholz Date: Fri, 13 Jul 2018 17:14:55 +0000 (+0200) Subject: codegen: Don't emit g_type_add_instance_private() in *_register_type() X-Git-Tag: 0.41.90~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb669029dbd56e1d60586b39161f4948250c2f56;p=thirdparty%2Fvala.git codegen: Don't emit g_type_add_instance_private() in *_register_type() This fixes warnings like "sys:1: Warning: cannot add private field to invalid (non-instantiatable) type ..." Regression of df56f916e52e5efe3876afed59a6190f6cead1c8 --- diff --git a/codegen/valatyperegisterfunction.vala b/codegen/valatyperegisterfunction.vala index c1811d949..750537500 100644 --- a/codegen/valatyperegisterfunction.vala +++ b/codegen/valatyperegisterfunction.vala @@ -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))));