From e93cf1a6b4238f006d52eabf08d662758b3f6d3a Mon Sep 17 00:00:00 2001 From: Ellen Arteca Date: Fri, 4 Oct 2024 15:46:36 -0700 Subject: [PATCH] Fix kotlin trait methods and callbacks conversion for opaque types (#706) * Fix kotlin trait method and cb struct and enum returns * Fixing for opaque types in callback/trait --------- Co-authored-by: Ellen Arteca --- tool/src/kotlin/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tool/src/kotlin/mod.rs b/tool/src/kotlin/mod.rs index a72b9ccea..51edb8b63 100644 --- a/tool/src/kotlin/mod.rs +++ b/tool/src/kotlin/mod.rs @@ -1072,6 +1072,10 @@ returnVal.option() ?: return null Type::Slice(_) => { panic!("Non-primitive slices are not allowed as callback args") } + Type::Opaque(_) => ( + format!("{}({}, listOf())", in_ty, in_name), + format!("{}: Pointer", in_name), + ), _ => (in_name.clone(), format!("{}: {}", in_name, in_ty)), }) .unzip(); @@ -1534,6 +1538,10 @@ returnVal.option() ?: return null Type::Slice(_) => { panic!("Non-primitive slices are not allowed as callback args") } + Type::Opaque(_) => ( + format!("{}({}, listOf())", in_ty, in_name), + format!("{}: Pointer", in_name), + ), _ => (in_name.clone(), format!("{}: {}", in_name, in_ty)), }) .unzip();