mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
Move deprecation alerts to valid location
As discussed in https://github.com/ocaml/ocaml/issues/14078, alerts (with deprecation alerts as a special case) are not currently supported as item-attributes on let-bindings. This usage produces `misplaced-attribute` warnings, such as ``` Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context File "src/core/opentelemetry.ml", line 1229, characters 37-47: 1229 | let add_event = Scope.add_event [@@deprecated "use Scope.add_event"] ^^^^^^^^^^ Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context File "src/core/opentelemetry.ml", line 1231, characters 37-47: 1231 | let add_attrs = Scope.add_attrs [@@deprecated "use Scope.add_attrs"] ^^^^^^^^^^ Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context ``` Fortunately, we can still add deprecation alerts to these value by moving the alert to the pattern, as done here.
This commit is contained in:
parent
885d0b6a75
commit
e66476015b
1 changed files with 2 additions and 2 deletions
|
|
@ -1226,9 +1226,9 @@ module Trace = struct
|
|||
}
|
||||
[@@deprecated "use Scope.t"]
|
||||
|
||||
let add_event = Scope.add_event [@@deprecated "use Scope.add_event"]
|
||||
let (add_event [@deprecated "use Scope.add_event"]) = Scope.add_event
|
||||
|
||||
let add_attrs = Scope.add_attrs [@@deprecated "use Scope.add_attrs"]
|
||||
let (add_attrs [@deprecated "use Scope.add_attrs"]) = Scope.add_attrs
|
||||
|
||||
let with_' ?(force_new_trace_id = false) ?trace_state ?service_name
|
||||
?(attrs : (string * [< value ]) list = []) ?kind ?trace_id ?parent ?scope
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue