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

Support named enum in derive #22

Open
dannywillems opened this issue Jun 22, 2023 · 0 comments
Open

Support named enum in derive #22

dannywillems opened this issue Jun 22, 2023 · 0 comments

Comments

@dannywillems
Copy link
Member

dannywillems commented Jun 22, 2023

See https://github.com/o1-labs/ocaml-gen/blob/main/ocaml-gen/derive/src/lib.rs#L214

For instance:

    #[derive(ocaml::IntoValue, ocaml::FromValue, ocaml_gen::Struct)]
    pub struct CamlRuntimeTableSpec {
        pub id: i32,
        pub len: usize
    }


    #[derive(ocaml::IntoValue, ocaml::FromValue, ocaml_gen::Enum)]
    pub enum CamlRuntimeTableCfg<CamlF> {
        Indexed(CamlRuntimeTableSpec),
        Custom {
            id: i32,
            first_column: Vec<CamlF>
        }
    }

will give:

    |
128 |     #[derive(ocaml::IntoValue, ocaml::FromValue, ocaml_gen::Enum)]
    |                                                  ^^^^^^^^^^^^^^^
    |
    = help: message: named types not implemented
@dannywillems dannywillems changed the title Provide enum derive Support named enum in derive Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant