rescript-vscode icon indicating copy to clipboard operation
rescript-vscode copied to clipboard

@deriving({abstract: light}) record labels marked as "never used to read a value"

Open edelvalle opened this issue 3 years ago • 0 comments

I'm using:

  • ReScript: 9.1.4
  • VSCode plugin: 1.4.2

when having this code:

@deriving({abstract: light})
type someType = {field: string}

let f = a => a->field

What happens:

I get a warning on the 2nd line, under "field: string", saying that "someType.field is a record label never used to read a value"

What should happen:

There should be no warning, why? Because I'm actually reading from that field.

Proof: If I change the name of field in the type declaration or use other name after the a-> the code does not compile, which is correct and also probes that that declaration is being used.

edelvalle avatar Jul 30 '22 07:07 edelvalle