links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
318 stars 42 forks source link

ppx_sexp_conv creates code triggering warning 40 #1187

Closed frank-emrich closed 8 months ago

frank-emrich commented 9 months ago

When using version 16.0 of the ppx_sexp_conv package, types annotated with [@@deriving sexp] may obtain sexp conversion functions whose body triggers warning 40, as seen in the following example:

File "lens/column.ml", lines 4-11, characters 0-23:
 4 | type t = {
 5 |   table : string;
 6 |   name : string;
 7 |   alias : string;
 8 |   typ : Type.t;
 9 |   present : bool;
10 | }
11 | [@@deriving show, sexp]
Warning 40 [name-out-of-scope]: Required was selected from type Sexplib0.Sexp_conv_record.Kind.t.
It is not visible in the current scope, and will not 
be selected if the type becomes unknown
jamescheney commented 8 months ago

Is this actually closed by #1188? I still seem to be seeing these warnings when rebuilding at least using ocaml 4.14

Never mind, I wasn't in the master branch when I saw this

dhil commented 8 months ago

Yes, it should be fixed by #1188.

frank-emrich commented 8 months ago

I didn't close this issue because I consider #1188 more of a workaround than a clean fix. But I don't see myself taking the time to look into the root cause and file an upstream bug with ppx_sexp_conv in the near future, so let's keep this closed.