Commit 41c4fc0d7f1b57fb23a37882b7869ee8944a3b48

Thomas de Grivel 2023-03-15T07:19:19

cfn

diff --git a/libc3/cfn.c b/libc3/cfn.c
index b29e457..4780568 100644
--- a/libc3/cfn.c
+++ b/libc3/cfn.c
@@ -74,8 +74,9 @@ s_cfn * cfn_copy (const s_cfn *cfn, s_cfn *dest)
   assert(cfn);
   assert(dest);
   str_copy(&cfn->name, &dest->name);
-  dest->arity = cfn->arity;
   list_copy(cfn->arg_types, &dest->arg_types);
+  dest->arity = cfn->arity;
+  dest->result_type = cfn->result_type;
   return dest;
 }
 
@@ -258,6 +259,8 @@ const s_sym * cfn_tag_type_to_sym (e_tag_type tag_type)
 
 void * cfn_tag_to_ffi_value (s_tag *tag, const s_sym *type)
 {
+  if (type == sym_1("tag"))
+    return tag;
   switch (tag->type.type) {
   case TAG_VOID:
     if (type == sym_1("void"))