Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cookie creation for trait struct in Kotlin #729

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: tool/src/kotlin/mod.rs
assertion_line: 2424
assertion_line: 2422
expression: result
---
package dev.gigapixel.somelib
Expand Down Expand Up @@ -168,8 +168,9 @@ internal class DiplomatTrait_TesterTrait_Wrapper internal constructor (
vtable.run_testEnumReturn_callback = testEnumReturn;
val native_wrapper = DiplomatTrait_TesterTrait_Wrapper_Native();
native_wrapper.vtable = vtable;
native_wrapper.data_ = DiplomatJVMRuntime.buildRustCookie(native_wrapper as Object);
return DiplomatTrait_TesterTrait_Wrapper(native_wrapper);
val ret_val = DiplomatTrait_TesterTrait_Wrapper(native_wrapper);
ret_val.nativeStruct.data_ = DiplomatJVMRuntime.buildRustCookie(ret_val as Object);
return ret_val;
}
}
}
5 changes: 3 additions & 2 deletions tool/templates/kotlin/Trait.kt.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ internal class DiplomatTrait_{{trait_name}}_Wrapper internal constructor (
{% endif -%}
val native_wrapper = DiplomatTrait_{{trait_name}}_Wrapper_Native();
native_wrapper.vtable = vtable;
native_wrapper.data_ = DiplomatJVMRuntime.buildRustCookie(native_wrapper as Object);
return DiplomatTrait_{{trait_name}}_Wrapper(native_wrapper);
val ret_val = DiplomatTrait_{{trait_name}}_Wrapper(native_wrapper);
ret_val.nativeStruct.data_ = DiplomatJVMRuntime.buildRustCookie(ret_val as Object);
return ret_val;
}
}
}
Expand Down