[vala/0.36] codegen: Include required type-definition when casting from generic pointer



commit 7050633d2f663480d15b90866372c7489c9eac97
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Jul 26 14:03:12 2019 +0200

    codegen: Include required type-definition when casting from generic pointer
    
    Fixes https://gitlab.gnome.org/GNOME/vala/issues/828

 codegen/valaccodebasemodule.vala | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 282c49378..5647f5ce9 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5761,6 +5761,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));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]