From eaa863282c7b18511194b4073a80f05d58806ba1 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 5 Sep 2023 00:13:34 +0000 Subject: [PATCH] [C#] Add missing handling of traits with supertraits of supertraits In 831ad69f1f65d26c224fe18003f1694806effa5a support was added for handling traits with supertraits of supertraits, but the full patch was not applied to the C# bindings, which is finished here. --- csharp_strings.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/csharp_strings.py b/csharp_strings.py index 5361302b..6f017081 100644 --- a/csharp_strings.py +++ b/csharp_strings.py @@ -703,17 +703,21 @@ namespace org { namespace ldk { namespace structs { java_trait_constr = java_trait_constr + ", " + var.arg_name else: java_trait_constr += ", " + var[1] + ".new_impl(" + var[1] + "_impl" + suptrait_constr = "" for suparg in var[2]: if isinstance(suparg, ConvInfo): - java_trait_constr += ", " + suparg.arg_name + suptrait_constr += ", " + suparg.arg_name else: - java_trait_constr += ", " + suparg[1] - java_trait_constr += ").bindings_instance" + suptrait_constr += ", " + suparg[1] + "_impl" + java_trait_constr += suptrait_constr + ").bindings_instance" for suparg in var[2]: if isinstance(suparg, ConvInfo): java_trait_constr += ", " + suparg.arg_name else: - java_trait_constr += ", " + suparg[1] + java_trait_constr += ", " + suparg[1] + ".new_impl(" + # Blindly assume that we can just strip the first arg to build the args for the supertrait + java_trait_constr += suptrait_constr.split(", ", 1)[1] + java_trait_constr += ").bindings_instance" out_java_trait += "\t}\n" + java_trait_wrapper + "\n" out_java_trait += java_trait_constr + ");\n\t\treturn impl_holder.held;\n\t}\n" -- 2.39.5