summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2023-02-05 19:33:15 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2023-02-05 20:05:30 +0100
commitfe1633c15bc5a572ba45b59c7612a3eb352503f2 (patch)
treec801ffc69c11fb20cecf9bf31c25bbdb4118f57d /codegen
parent6121633021de361e8769ea53fc68ac812b731eb4 (diff)
downloadvala-fe1633c15bc5a572ba45b59c7612a3eb352503f2.tar.gz
codegen: Cast return value of generic type accessor functions
Found by -Wincompatible-function-pointer-types See https://gitlab.gnome.org/GNOME/vala/issues/1408
Diffstat (limited to 'codegen')
-rw-r--r--codegen/valagtypemodule.vala2
1 files changed, 1 insertions, 1 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);