Skip to content

Commit

Permalink
Merge pull request #41 from andersfugmann/andersfugmann/fix_deprecati…
Browse files Browse the repository at this point in the history
…on_annotations

Fix deprecation annotation for let bindings when using ocaml 5.2
  • Loading branch information
andersfugmann authored Jun 5, 2024
2 parents 20c77b8 + 3597079 commit 51d6940
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/plugin/code.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ let append_deprecaton_if ~deprecated level str =
| false -> str
| true ->
let level = match level with
| `Attribute-> "@"
| `Attribute -> "@"
| `Item -> "@@"
| `Floating -> "@@@"
in
Expand Down
3 changes: 1 addition & 2 deletions src/plugin/emit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@ let emit_service_type ~scope ~comment_db ~type_db ServiceDescriptorProto.{ name;
Code.emit implementation `None "module Response = %s" output;
Code.emit implementation `End "end%s" (Code.append_deprecaton_if ~deprecated `Item "");
Code.emit implementation `None "";
Code.emit implementation `Begin "let %s : %s = " method_name sig_t';
Code.emit implementation `Begin "let %s = " (Code.append_deprecaton_if ~deprecated `Attribute method_name);
Code.emit implementation `None "(module %s : Runtime'.Spec.Message with type t = %s.t ), " input input;
Code.emit implementation `None "(module %s : Runtime'.Spec.Message with type t = %s.t )" output output;
Code.emit implementation `None "%s" (Code.append_deprecaton_if ~deprecated `Item "");
Code.emit implementation `End "";
in
let name = Option.value_exn ~message:"Service definitions must have a name" name in
Expand Down

0 comments on commit 51d6940

Please sign in to comment.