Skip to content

message to message alias #27

Description

@ygrek

It appears extprot accepts message alias to message, but generates bad code. This possibility is not documented afaik, not sure if it should be fixed or forbidden, I stumbled on this accidentaly.
Consider :

$ cat a.proto 
message m1 = { a : int }
message m2 = M1.m1
$ ./compiler/extprotc a.proto -o /dev/stdout   |grep M1
module M1 =
        [ ("M1.a", (Extprot.Pretty_print.pp_field (fun t -> t.a) Extprot.Pretty_print.pp_int)) ] pp;;
    type _m2 = M1.M1.m1;;
    type m2 = M1.M1.m1;;
    let m2_default = ref (fun () -> !M1.M1.m1_default ());;
    let pp_m2 pp = M1.M1.pp_m1 pp;;
    let read_m2 s = M1.M1.read_m1 s;;
    let io_read_m2 s = M1.M1.io_read_m1 s;;
    let write_m2 b msg = M1.M1.write_m1 b msg;;

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions