Skip to content

Does not support passing builtin types as type parameters #5

@struktured

Description

@struktured

type 'a range = {min:'a [@key 1]; max:'a [@key 2]} [@@deriving Protobuf];;

_type 'a range = { min : 'a; max : 'a; } val range_from_protobuf : (Protobuf.Decoder.t -> 'a) -> Protobuf.Decoder.t -> 'a range = val range_to_protobuf : ('a -> Protobuf.Encoder.t -> unit) -> 'a range -> Protobuf.Encoder.t -> unit = *

type string_range = string range [@@deriving Protobuf];;

*Error: Unbound value string_from_protobuf_

For completeness, note that following works fine:

type foo = string [@@deriving Protobuf];;

type foo = bytes val foo_from_protobuf : Protobuf.Decoder.t -> bytes = val foo_to_protobuf : bytes -> Protobuf.Encoder.t -> unit =

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions