Closed frank-emrich closed 1 year ago
I'm planning to find a better solution for #1187 eventually (e.g., looking into the generated code in detail and reporting a bug with the ppx_sexp_conv
authors). In the meantine, this updated workaround is friendlier for end users and should be part of the upcoming Links release (as it avoids forcing users to install an outdated version of ppx_sexp_conv
).
This PR implements a better workaround for #1187.
The previous workaround was to force using an older version of the
ppx_sexp_conv
, which did not exhibit issue #1187. As such a version constraint may inconvenience users, this PR removes the version constraint and touches the problematic uses of@@deriving sexp
directly.Unforutnately, locally suppressing the warning code 40 triggered by the code generated for
@@deriving sexp
is somewhat tricky, as there is no AST node in the original source file to attach anocaml.warning
attribute to.This PR circumvents this problem by wrapping the affected type definitions in an anonymous module, disabling warning 40 within that whole module, and then immediately
include
ing said module.This limits the scope in which we actually disable warning 40 to exactly where it is needed.