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



commit e1b1f2972f60565f10e46f58c653cfe48be3c39e
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 c34503091..9b64b478e 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5894,6 +5894,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]