From 169cd07aaf009a7fff46109ad429dbdd309fd931 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Thu, 5 Dec 2024 19:37:18 +0300 Subject: [PATCH] Migrating to IList from ValList for []any bindings since it is more generic --- src/bind.inc.php | 2 +- tpl/bhl_bind_macro.twig | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/bind.inc.php b/src/bind.inc.php index 07ed464..d76cbd2 100644 --- a/src/bind.inc.php +++ b/src/bind.inc.php @@ -535,7 +535,7 @@ function native_type(\mtgType $type) if($type instanceof \mtgArrType) { if($type->getValue()->getName() == "any") - return "bhl.ValList"; + return "IList"; else return "IList<".native_type($type->getValue()).">"; } diff --git a/tpl/bhl_bind_macro.twig b/tpl/bhl_bind_macro.twig index 6708b7c..f5a2b3d 100644 --- a/tpl/bhl_bind_macro.twig +++ b/tpl/bhl_bind_macro.twig @@ -384,16 +384,11 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack {%- macro dispose_args(o, arg_prefix = '') -%} {%- for arg in o.args -%} {% if arg.type is instanceof('\\mtgArrType') %} - {% if arg.type.value.name == 'any' %} - {{arg_prefix}}{{arg.name}}?.Release(); - {{arg_prefix}}{{arg.name}} = default; - {% else %} { if({{arg_prefix}}{{arg.name}} is IValRefcounted rfc) rfc.Release(); {{arg_prefix}}{{arg.name}} = default; } - {% endif %} {% endif %} {% if arg.type.name == 'any' %} @@ -463,7 +458,7 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack {%~ if type == 'any[]'-%} - {{native}} = (ValList){{value}}._obj; + {{native}} = (IList){{value}}._obj; {%~ else ~%}