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

Enum field in dictionary support #36

Closed
eoger opened this issue Jul 28, 2020 · 2 comments · Fixed by #184
Closed

Enum field in dictionary support #36

eoger opened this issue Jul 28, 2020 · 2 comments · Fixed by #184
Assignees
Labels
blocks-nimbus Blocks Nimbus SDK on mobile

Comments

@eoger
Copy link
Contributor

eoger commented Jul 28, 2020

I want to be able to compile this :

enum BoboType {
  "TRON",
  "ZORD",
};

dictionary TestMock {
  BoboType name_suffix_variant;
};

┆Issue is synchronized with this Jira Task

@tarikeshaq
Copy link
Member

+1 For BoboType 🤣

I think this is a good first issue!

To make this possible:

  • One would need to implement Lowerable and Liftable for enum types, the traits can be found here
  • This could fit nicely in here
  • Probably do the lifting and lowering very similar to how ViaFfi is implemented on the above file

@rfk
Copy link
Collaborator

rfk commented Jul 28, 2020

One would need to implement Lowerable and Liftable for enum types

Right, and in practice, these could probably just call into_ffi_value/try_from_ffi_value to convert to a u32 and then read/write it directly in the buffer.

@eoger eoger added the blocks-nimbus Blocks Nimbus SDK on mobile label Jul 29, 2020
@data-sync-user data-sync-user changed the title Enum field in dictionary support SYNC-1554 ⁃ Enum field in dictionary support Jul 30, 2020
@eoger eoger self-assigned this Jul 30, 2020
@data-sync-user data-sync-user changed the title SYNC-1554 ⁃ Enum field in dictionary support Enum field in dictionary support Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocks-nimbus Blocks Nimbus SDK on mobile
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants