]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Include required type-definition when casting from generic pointer 768f7a28de01f9521e1f160899256517a65c5ba5
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 26 Jul 2019 12:03:12 +0000 (14:03 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 26 Jul 2019 12:03:12 +0000 (14:03 +0200)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/828

codegen/valaccodebasemodule.vala

index 783aa06e8ae795564c2f3961f28713b0d5f1d13c..1e2b4b38e796af5878cfecef57893c49fd0acfb3 100644 (file)
@@ -5874,6 +5874,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        public CCodeExpression convert_from_generic_pointer (CCodeExpression cexpr, DataType actual_type) {
                var result = cexpr;
                if (is_reference_type_argument (actual_type) || is_nullable_value_type_argument (actual_type)) {
+                       generate_type_declaration (actual_type, cfile);
                        result = new CCodeCastExpression (cexpr, get_ccode_name (actual_type));
                } else if (is_signed_integer_type_argument (actual_type)) {
                        result = new CCodeCastExpression (new CCodeCastExpression (cexpr, "gintptr"), get_ccode_name (actual_type));