rescript-lang / rescript-lang/reanalyze

Confusing dead code warning at module include

Open
#155 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
OCaml
Stars
281
Forks
22
Avg merge
1d 19h
Merged PRs (30d)
7

Description

Running reanalyze https://github.com/rescript-association/reanalyze/commit/389dd682223201b42c33e5c444e5c79e0805adad on Goblint https://github.com/goblint/analyzer/commit/a544002114324a207df72f9e79eb656c3ebe7b5b revealed the following.

At this include of Batteries into a module named All, reanalyze complains about Ana.result.Error being dead:

module All = struct
  include (Batteries : module type of Batteries with module Format := Batteries.Format [@dead "Ana.result.Error"] )
  (* ... *)
end

The complete file can be viewed here: https://github.com/goblint/analyzer/blob/a544002114324a207df72f9e79eb656c3ebe7b5b/src/prelude.ml.

I could not figure out what it's complaining about there or why.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report using reanalyze commit 389dd682223201b42c33e5c444e5c79e0805adad on Goblint commit a544002114324a207df72f9e79eb656c3ebe7b5b. Start with src/prelude.ml and the Batteries include in module All, then trace why Ana.result.Error is reported as dead. Done means explaining the warning and correcting it if it is spurious.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.