rescript-lang / rescript-lang/reanalyze

Dead Types wrt consumed types

Open
#169 7 comments 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

Hi again Cristiano.
Just added dce to our CI process and going through the output i get:

Warning Dead Type
  File "/home/circleci/noble/web/src/requests.res", line 200, characters 2-17
  argsClone.with_data is a record label never used to read a value
  <-- line 200
    @dead("argsClone.with_data") with_data: bool,

argsClone is consumed by an external Axios.post, and this type is a preposition for our clone action, so these warnings seem like false positive to me. Its not wrong, granted, but suggests I can remove that field which is wrong.

Are you doing any work in this direction?

Thanks!
Alex

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

Start by examining the dead-code-elimination warning reported for requests.res at line 200, especially argsClone.with_data, and reproduce the CI output if possible. Trace how argsClone is consumed by the external Axios.post and determine what behavior the analysis should recognize; done means this externally consumed field is no longer incorrectly reported as dead.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.