[ https://issues.apache.org/jira/browse/THRIFT-5208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601085#comment-17601085 ]
Yawar Amin edited comment on THRIFT-5208 at 9/7/22 1:41 AM: ------------------------------------------------------------ Should be fixable with a one-line change at https://github.com/apache/thrift/blob/8a32156dd26d418ad5c35cd6ab912a01d6aaf843/compiler/cpp/src/thrift/generate/t_ocaml_generator.cc#L1668 {code} 1668: - if (ttype->is_service()) { 1668: + if (ttype->is_service() || ttype->is_xception()) { {code} I'll try to send a PR soon, if no one beats me to it :-) was (Author: mxbu9o4wdgrh): Should be fixable with a one-line change at https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_ocaml_generator.cc#L1668 {code} 1668: - if (ttype->is_service()) { 1668: + if (ttype->is_service() || ttype->is_xception()) { {code} I'll try to send a PR soon, if no one beats me to it :-) > OCaml codegen exception pattern match syntax error > -------------------------------------------------- > > Key: THRIFT-5208 > URL: https://issues.apache.org/jira/browse/THRIFT-5208 > Project: Thrift > Issue Type: Bug > Components: OCaml - Compiler > Affects Versions: 0.12.0 > Reporter: Yawar Amin > Priority: Major > > For the following exception: > {code} > exception Ex { > 1: required string message > } > {code} > The following class and exception are generated: > {code} > class ex : object ('a) > ... > end > exception Ex of ex > ... > (try ... > with > | ex e -> ... > {code} > This is a syntax error as all constructors (like {{ex}}) must start with an > uppercase letter. It can be fixed by outputting {{| Ex e -> ...}}. -- This message was sent by Atlassian Jira (v8.20.10#820010)