Skip to content

Conversation

@fantazio
Copy link
Collaborator

@fantazio fantazio commented Jan 26, 2026

It is not uncommon to use a .ml (without .mli) to expose module types and include these in other module's .mli. A minimal example of this pattern is reproduced in examples/using_dune/lib/values/include_modtype.

A more complex pattern, found in Frama-C, is reproduced in examples/using_dune/lib/values/builder_sig_api. This is an extension of the above, with intermediate functors.

This change includes a small fix in the test engine. The report line comparison was done on whole lines (for lexicographical order), rather than by parts. This means foo.ml:9: .. was considered greater than foo.ml:10: ..., and thus expected to appear later in the reports, when in the reports the former is actually supposed to appear first. Because of this, the test reports could wrongly identify some FP and FN after an actual FP/FN.

The FP and FN introduced are tracked by #50.

The new pattern was observed on Frama-C. It is described in
`examples/using_dune/lib/values/builder_sig_api/README.md`.
It uses a mix of module types, functors and includes dispatched in
multiple files.

It is not uncommon to use a `.ml` (without `.mli`) to expose module
types and reuse these in other module's `.mli`. This pattern will need
to be tested more specifically.

The new tests results (`.ref`) expose a minor bug in the test engine.
This should be easy to fix.
The comparison was on the whole line at one to obtain a lexicographical
order. The tests in the previous commit show that this ordering is to
shallow for report lines. Instead, they should be compared closer to how
the analyzer does it : by filename first, then by line (the analyzer
actually has more precise locations internally), then by value.
It is not uncommon to use a `.ml` (without `.mli`) to expose module
types and include these in other module's `.mli`.
The new tests specifically target this pattern with a toplevel `include`
@fantazio fantazio marked this pull request as draft January 27, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant