Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1992

Record in list decomposed in a single step needs type hint, is this a bug?

$
0
0

Just noticing in multiple scenarios that the following decomposition

let ({a, b}, y) = someValue

gives an error the record field a can't be found, so I need to add an explicit type annotation to {a, b} like {a, b}: rType to make it pass.

However if the same decomposition is done in two steps, it works without the annotation.

let (x, y) = someValue
let {a, b} = x

Is this a bug that I should report, or is this a known limitation? If the latter, what’s the reason behind it?

(Rescript 11.0.0-rc.8)


Viewing all articles
Browse latest Browse all 1992

Latest Images

Trending Articles



Latest Images