Skip to content

Commit 51d6940

Browse files
Merge pull request #41 from andersfugmann/andersfugmann/fix_deprecation_annotations
Fix deprecation annotation for let bindings when using ocaml 5.2
2 parents 20c77b8 + 3597079 commit 51d6940

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/plugin/code.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ let append_deprecaton_if ~deprecated level str =
104104
| false -> str
105105
| true ->
106106
let level = match level with
107-
| `Attribute-> "@"
107+
| `Attribute -> "@"
108108
| `Item -> "@@"
109109
| `Floating -> "@@@"
110110
in

src/plugin/emit.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,9 @@ let emit_service_type ~scope ~comment_db ~type_db ServiceDescriptorProto.{ name;
137137
Code.emit implementation `None "module Response = %s" output;
138138
Code.emit implementation `End "end%s" (Code.append_deprecaton_if ~deprecated `Item "");
139139
Code.emit implementation `None "";
140-
Code.emit implementation `Begin "let %s : %s = " method_name sig_t';
140+
Code.emit implementation `Begin "let %s = " (Code.append_deprecaton_if ~deprecated `Attribute method_name);
141141
Code.emit implementation `None "(module %s : Runtime'.Spec.Message with type t = %s.t ), " input input;
142142
Code.emit implementation `None "(module %s : Runtime'.Spec.Message with type t = %s.t )" output output;
143-
Code.emit implementation `None "%s" (Code.append_deprecaton_if ~deprecated `Item "");
144143
Code.emit implementation `End "";
145144
in
146145
let name = Option.value_exn ~message:"Service definitions must have a name" name in

0 commit comments

Comments
 (0)