diff options
-rw-r--r-- | codegen/valagtypemodule.vala | 2 | ||||
-rw-r--r-- | tests/generics/bug640330.c-expected | 6 | ||||
-rw-r--r-- | tests/objects/interface-async-captured-generic.c-expected | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala index b3d7d247f..0d9fae482 100644 --- a/codegen/valagtypemodule.vala +++ b/codegen/valagtypemodule.vala @@ -1404,7 +1404,7 @@ public class Vala.GTypeModule : GErrorModule { var this_type = SemanticAnalyzer.get_data_type_for_symbol (cl); function.add_parameter (new CCodeParameter ("self", get_ccode_name (this_type))); push_function (function); - ccode.add_return (expression); + ccode.add_return (new CCodeCastExpression (expression, return_type)); pop_function (); cfile.add_function (function); diff --git a/tests/generics/bug640330.c-expected b/tests/generics/bug640330.c-expected index 4b9d88858..22aafedeb 100644 --- a/tests/generics/bug640330.c-expected +++ b/tests/generics/bug640330.c-expected @@ -210,19 +210,19 @@ bar_class_init (BarClass * klass, static GType bar_foo_get_g_type (Bar* self) { - return self->priv->g_type; + return (GType) self->priv->g_type; } static GBoxedCopyFunc bar_foo_get_g_dup_func (Bar* self) { - return self->priv->g_dup_func; + return (GBoxedCopyFunc) self->priv->g_dup_func; } static GDestroyNotify bar_foo_get_g_destroy_func (Bar* self) { - return self->priv->g_destroy_func; + return (GDestroyNotify) self->priv->g_destroy_func; } static void diff --git a/tests/objects/interface-async-captured-generic.c-expected b/tests/objects/interface-async-captured-generic.c-expected index ed43ffed9..ece032b76 100644 --- a/tests/objects/interface-async-captured-generic.c-expected +++ b/tests/objects/interface-async-captured-generic.c-expected @@ -223,19 +223,19 @@ foo_class_init (FooClass * klass, static GType foo_ifoo_get_g_type (Foo* self) { - return G_TYPE_STRING; + return (GType) G_TYPE_STRING; } static GBoxedCopyFunc foo_ifoo_get_g_dup_func (Foo* self) { - return g_strdup; + return (GBoxedCopyFunc) g_strdup; } static GDestroyNotify foo_ifoo_get_g_destroy_func (Foo* self) { - return g_free; + return (GDestroyNotify) g_free; } static void |