Skip to content

Commit

Permalink
Fix kotlin trait methods and callbacks conversion for opaque types (#706
Browse files Browse the repository at this point in the history
)

* Fix kotlin trait method and cb struct and enum returns

* Fixing for opaque types in callback/trait

---------

Co-authored-by: Ellen Arteca <[email protected]>
  • Loading branch information
emarteca and Ellen Arteca authored Oct 4, 2024
1 parent a3870ea commit e93cf1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tool/src/kotlin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e93cf1a

Please sign in to comment.