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

JS code generation does not work with single-field structures #173

Open
eggrobin opened this issue Jun 15, 2022 · 2 comments
Open

JS code generation does not work with single-field structures #173

eggrobin opened this issue Jun 15, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eggrobin
Copy link

This was previously spotted in #70, as the example had such a struct, but the fix to that issue was merely to change the example so it did not rely on behaviour not yet implemented.

[cargo-make] INFO - Running Task: diplomat-gen-js
thread 'main' panicked at 'not yet implemented: Receiving structs that don't need a buffer', tool\src\js\conversions.rs:121:25

This is a problem for ICU4X, as the removal of the sign_display option from ICU4XFixedDecimalFormatOptions (as part of unicode-org/icu4x#1267, see unicode-org/icu4x#2025 (comment)) turns it into a single-field struct:

             ICU4XFixedDecimalFormatOptions {
                 grouping_strategy: ICU4XFixedDecimalGroupingStrategy::Auto,
-                sign_display: ICU4XFixedDecimalSignDisplay::Auto,
             }
@Manishearth
Copy link
Contributor

Yeah we'll basically have to special case codegen there, because WASM treats these differently.

@Manishearth Manishearth self-assigned this Jun 15, 2022
eggrobin added a commit to eggrobin/icu4x that referenced this issue Jun 15, 2022
@Manishearth
Copy link
Contributor

if needs_buffer != ReturnTypeForm::Complex {
todo!("Receiving structs that don't need a buffer")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants