Skip to content

Rust default array fix#8585

Open
jergussuja wants to merge 6 commits intogoogle:masterfrom
jergussuja:rust-default-array-fix
Open

Rust default array fix#8585
jergussuja wants to merge 6 commits intogoogle:masterfrom
jergussuja:rust-default-array-fix

Conversation

@jergussuja
Copy link

Generated object api struct implement Default trait by derive macro, but array implement Default trait only for size up to 32 (source).

Main contribution goes to @DolajoCZ, I just verified C++ code changes!

Fixes #8436.

@google-cla
Copy link

google-cla bot commented Apr 24, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added c++ codegen Involving generating code from schema rust labels Apr 24, 2025
@jergussuja jergussuja force-pushed the rust-default-array-fix branch from 040d19f to b78e10d Compare April 24, 2025 14:46
@DolajoCZ DolajoCZ mentioned this pull request May 12, 2025
@TethysSvensson
Copy link
Contributor

This fails to generate valid code for the following schema:

struct MyStruct2 {
  x: float;
}

struct MyStruct {
  x: [MyStruct2: 10];
}

table Root {
  x: MyStruct;
}

@jergussuja
Copy link
Author

This fails to generate valid code for the following schema:
...

Thanks for your check! Should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema rust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust default for array

3 participants